Skip to content

Commit

Permalink
[E2E] Enable StarRocksCDCSinkIT (#6626)
Browse files Browse the repository at this point in the history
  • Loading branch information
liunaijie authored Apr 2, 2024
1 parent cdb1856 commit 2346d0e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@

import org.apache.seatunnel.e2e.common.TestResource;
import org.apache.seatunnel.e2e.common.TestSuiteBase;
import org.apache.seatunnel.e2e.common.container.ContainerExtendedFactory;
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.apache.seatunnel.e2e.common.junit.TestContainerExtension;

import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.TestTemplate;
import org.testcontainers.containers.Container;
import org.testcontainers.containers.GenericContainer;
Expand Down Expand Up @@ -53,7 +56,6 @@
import static org.awaitility.Awaitility.given;

@Slf4j
@Disabled("There are still errors unfixed @Hisoka-X")
public class StarRocksCDCSinkIT extends TestSuiteBase implements TestResource {
private static final String DOCKER_IMAGE = "d87904488/starrocks-starter:2.2.1";
private static final String DRIVER_CLASS = "com.mysql.cj.jdbc.Driver";
Expand Down Expand Up @@ -87,6 +89,18 @@ public class StarRocksCDCSinkIT extends TestSuiteBase implements TestResource {
private Connection jdbcConnection;
private GenericContainer<?> starRocksServer;

@TestContainerExtension
private final ContainerExtendedFactory extendedFactory =
container -> {
Container.ExecResult extraCommands =
container.execInContainer(
"bash",
"-c",
"mkdir -p /tmp/seatunnel/plugins/Jdbc/lib && cd /tmp/seatunnel/plugins/Jdbc/lib && curl -O "
+ SR_DRIVER_JAR);
Assertions.assertEquals(0, extraCommands.getExitCode());
};

@BeforeAll
@Override
public void startUp() {
Expand Down Expand Up @@ -119,6 +133,10 @@ public void tearDown() throws Exception {
}

@TestTemplate
@DisabledOnContainer(
value = {},
type = {EngineType.SPARK},
disabledReason = "Currently Spark engine unsupported DELETE operation")
public void testStarRocksSink(TestContainer container) throws Exception {
Container.ExecResult execResult =
container.executeJob("/write-cdc-changelog-to-starrocks.conf");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ sink {
password = ""
database = "test"
table = "e2e_table_sink"

base-url = "jdbc:mysql://starrocks_cdc_e2e:9030/test"
batch_max_rows = 100
max_retries = 3

Expand Down

0 comments on commit 2346d0e

Please sign in to comment.