This is an automated email from the ASF dual-hosted git repository.
kirs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-seatunnel.git
The following commit(s) were added to refs/heads/dev by this push:
new e4b97b77c [Improve][Connector-V2][StarRocks]Add row numbers check in
StarRock e2e (#3421)
e4b97b77c is described below
commit e4b97b77c700587593f6cb7971c552f139eddb12
Author: TaoZex <[email protected]>
AuthorDate: Thu Nov 17 11:11:46 2022 +0800
[Improve][Connector-V2][StarRocks]Add row numbers check in StarRock e2e
(#3421)
* [Improve][Connector-V2][StarRocks]Add row numbers check in StarRock e2e
* [Improve][Connector-V2][StarRocks]Add truncate table in StarRocks e2e
* Update exception typo
---
.../seatunnel/e2e/connector/starrocks/StarRocksIT.java | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git
a/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-starrocks-e2e/src/test/java/org/apache/seatunnel/e2e/connector/starrocks/StarRocksIT.java
b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-starrocks-e2e/src/test/java/org/apache/seatunnel/e2e/connector/starrocks/StarRocksIT.java
index 185d08d8a..2f3e0aef8 100644
---
a/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-starrocks-e2e/src/test/java/org/apache/seatunnel/e2e/connector/starrocks/StarRocksIT.java
+++
b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-starrocks-e2e/src/test/java/org/apache/seatunnel/e2e/connector/starrocks/StarRocksIT.java
@@ -32,7 +32,6 @@ import lombok.extern.slf4j.Slf4j;
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;
@@ -63,7 +62,6 @@ import java.util.stream.Collectors;
import java.util.stream.Stream;
@Slf4j
-@Disabled("disable because it can not success")
public class StarRocksIT 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";
@@ -245,6 +243,11 @@ public class StarRocksIT extends TestSuiteBase implements
TestResource {
}
}
}
+ //Check the row numbers is equal
+ sourceResultSet.last();
+ sinkResultSet.last();
+ Assertions.assertEquals(sourceResultSet.getRow(),
sinkResultSet.getRow());
+ clearSinkTable();
} catch (Exception e) {
throw new RuntimeException("get starRocks connection error", e);
}
@@ -302,4 +305,12 @@ public class StarRocksIT extends TestSuiteBase implements
TestResource {
throw new RuntimeException("test starrocks server image error", e);
}
}
+
+ private void clearSinkTable() {
+ try (Statement statement = jdbcConnection.createStatement()) {
+ statement.execute(String.format("TRUNCATE TABLE %s.%s", DATABASE,
SINK_TABLE));
+ } catch (SQLException e) {
+ throw new RuntimeException("test starrocks server image error", e);
+ }
+ }
}