hailin0 commented on code in PR #5417:
URL: https://github.com/apache/seatunnel/pull/5417#discussion_r1371128648


##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-cdc-postgres-e2e/src/test/java/org/apache/seatunnel/e2e/connector/cdc/postgres/PostgresCDCIT.java:
##########
@@ -0,0 +1,315 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.e2e.connector.cdc.postgres;
+
+import org.apache.seatunnel.e2e.common.TestResource;
+import org.apache.seatunnel.e2e.common.TestSuiteBase;
+import org.apache.seatunnel.e2e.common.container.EngineType;
+import org.apache.seatunnel.e2e.common.container.TestContainer;
+import org.apache.seatunnel.e2e.common.junit.DisabledOnContainer;
+
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.TestTemplate;
+import org.testcontainers.containers.PostgreSQLContainer;
+import org.testcontainers.lifecycle.Startables;
+import org.testcontainers.utility.MountableFile;
+
+import lombok.extern.slf4j.Slf4j;
+
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Stream;
+
+import static org.awaitility.Awaitility.await;
+
+@Slf4j
+@DisabledOnContainer(
+        value = {},
+        type = {EngineType.SPARK, EngineType.FLINK},
+        disabledReason = "Currently SPARK and FLINK do not support cdc")
+public class PostgresCDCIT extends TestSuiteBase implements TestResource {
+
+    // postgres
+    private static final String POSTGRES_HOST = "postgres_cdc_e2e";
+    private static final String POSTGRES_USER_NAME = "postgres";
+    private static final String POSTGRES_USER_PASSWORD = "123456";
+    private static final String POSTGRES_DATABASE = "cdc_e2e";
+    private static final PostgreSQLContainer POSTGRES_CONTAINER = 
createPostgresContainer();
+
+    // postgres source table query sql
+    private static final String SOURCE_SQL =
+            "select \n"
+                    + "gid,\n"
+                    + "text_col,\n"
+                    + "varchar_col,\n"
+                    + "char_col,\n"
+                    + "boolean_col,\n"
+                    + "smallint_col,\n"
+                    + "integer_col,\n"
+                    + "bigint_col,\n"
+                    + "decimal_col,\n"
+                    + "numeric_col,\n"
+                    + "real_col,\n"
+                    + "double_precision_col,\n"
+                    + "smallserial_col,\n"
+                    + "serial_col,\n"
+                    + "bigserial_col,\n"
+                    + "date_col,\n"
+                    + "timestamp_col,\n"
+                    + "bpchar_col,\n"
+                    + "age,\n"
+                    + "name\n"
+                    + " from public.postgres_cdc_e2e_source_table";
+    private static final String SINK_SQL =
+            "select\n"
+                    + "  gid,\n"
+                    + "   text_col,\n"
+                    + "   varchar_col,\n"
+                    + "   char_col,\n"
+                    + "   boolean_col,\n"
+                    + "   smallint_col,\n"
+                    + "   integer_col,\n"
+                    + "   bigint_col,\n"
+                    + "   decimal_col,\n"
+                    + "   numeric_col,\n"
+                    + "   real_col,\n"
+                    + "   double_precision_col,\n"
+                    + "   smallserial_col,\n"
+                    + "   serial_col,\n"
+                    + "   bigserial_col,\n"
+                    + "   date_col,\n"
+                    + "   timestamp_col,\n"
+                    + "   bpchar_col,"
+                    + "  age,\n"
+                    + "  name \n"
+                    + "from\n"
+                    + "  public.postgres_cdc_e2e_sink_table";
+
+    private static PostgreSQLContainer createPostgresContainer() {
+        return new PostgreSQLContainer<>("postgres:11.1")
+                .withNetwork(NETWORK)
+                .withNetworkAliases(POSTGRES_HOST)
+                .withCopyFileToContainer(
+                        
MountableFile.forClasspathResource("docker/postgres.cnf"),
+                        "/usr/share/postgresql/postgresql.conf.sample")
+                .withUsername(POSTGRES_USER_NAME)
+                .withPassword(POSTGRES_USER_PASSWORD)
+                .withInitScript("ddl/postgres_cdc.sql")
+                .withDatabaseName(POSTGRES_DATABASE);
+    }
+
+    @BeforeAll
+    @Override
+    public void startUp() throws ClassNotFoundException, InterruptedException {
+        log.info("The second stage: Starting postgres containers...");
+        Startables.deepStart(Stream.of(POSTGRES_CONTAINER)).join();
+        log.info("postgres Containers are started");
+        log.info("postgres ddl execution is complete");
+    }
+
+    @TestTemplate
+    public void testpostgresCdcCheckDataE2e(TestContainer container)

Review Comment:
   Please refer to this  testcase
   
   
https://github.com/apache/seatunnel/blob/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-cdc-mysql-e2e/src/test/java/org/apache/seatunnel/connectors/seatunnel/cdc/mysql/MysqlCDCIT.java#L177



##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-cdc-postgres-e2e/src/test/java/org/apache/seatunnel/e2e/connector/cdc/postgres/PostgresCDCIT.java:
##########
@@ -0,0 +1,315 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.e2e.connector.cdc.postgres;
+
+import org.apache.seatunnel.e2e.common.TestResource;
+import org.apache.seatunnel.e2e.common.TestSuiteBase;
+import org.apache.seatunnel.e2e.common.container.EngineType;
+import org.apache.seatunnel.e2e.common.container.TestContainer;
+import org.apache.seatunnel.e2e.common.junit.DisabledOnContainer;
+
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.TestTemplate;
+import org.testcontainers.containers.PostgreSQLContainer;
+import org.testcontainers.lifecycle.Startables;
+import org.testcontainers.utility.MountableFile;
+
+import lombok.extern.slf4j.Slf4j;
+
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Stream;
+
+import static org.awaitility.Awaitility.await;
+
+@Slf4j
+@DisabledOnContainer(
+        value = {},
+        type = {EngineType.SPARK, EngineType.FLINK},
+        disabledReason = "Currently SPARK and FLINK do not support cdc")

Review Comment:
   remove?
   ```suggestion
           type = {EngineType.SPARK},
           disabledReason = "Currently SPARK do not support cdc")
   ```



##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-cdc-postgres-e2e/src/test/java/org/apache/seatunnel/e2e/connector/cdc/postgres/PostgresCDCIT.java:
##########
@@ -0,0 +1,315 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.e2e.connector.cdc.postgres;
+
+import org.apache.seatunnel.e2e.common.TestResource;
+import org.apache.seatunnel.e2e.common.TestSuiteBase;
+import org.apache.seatunnel.e2e.common.container.EngineType;
+import org.apache.seatunnel.e2e.common.container.TestContainer;
+import org.apache.seatunnel.e2e.common.junit.DisabledOnContainer;
+
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.TestTemplate;
+import org.testcontainers.containers.PostgreSQLContainer;
+import org.testcontainers.lifecycle.Startables;
+import org.testcontainers.utility.MountableFile;
+
+import lombok.extern.slf4j.Slf4j;
+
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Stream;
+
+import static org.awaitility.Awaitility.await;
+
+@Slf4j
+@DisabledOnContainer(
+        value = {},
+        type = {EngineType.SPARK, EngineType.FLINK},
+        disabledReason = "Currently SPARK and FLINK do not support cdc")

Review Comment:
   remove?
   ```suggestion
           type = {EngineType.SPARK},
           disabledReason = "Currently SPARK do not support cdc")
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to