From df5ae70e3bf9fd78d1ad645471622b3317f0e5db Mon Sep 17 00:00:00 2001 From: laglangyue <373435126@qq.com> Date: Wed, 31 Aug 2022 23:43:20 +0800 Subject: [PATCH] dm e2e --- .../apache/seatunnel/e2e/spark/SparkContainer.java | 13 ++++++++++++- .../e2e/spark/v2/jdbc/dm/DMSourceTOConsoleIT.java | 6 ++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/seatunnel-e2e/seatunnel-spark-connector-v2-e2e/src/test/java/org/apache/seatunnel/e2e/spark/SparkContainer.java b/seatunnel-e2e/seatunnel-spark-connector-v2-e2e/src/test/java/org/apache/seatunnel/e2e/spark/SparkContainer.java index 4a5bb8e5e62..4680eb8d72d 100644 --- a/seatunnel-e2e/seatunnel-spark-connector-v2-e2e/src/test/java/org/apache/seatunnel/e2e/spark/SparkContainer.java +++ b/seatunnel-e2e/seatunnel-spark-connector-v2-e2e/src/test/java/org/apache/seatunnel/e2e/spark/SparkContainer.java @@ -62,7 +62,9 @@ public abstract class SparkContainer { private static final int WAIT_SPARK_JOB_SUBMIT = 5000; - protected static List DRIVER_FROM_HTTP = new ArrayList<>(); + protected List customCommands() { + return new ArrayList<>(); + } @BeforeEach public void before() { @@ -138,6 +140,15 @@ protected void copySeaTunnelSparkFile() { master.copyFileToContainer( MountableFile.forHostPath(PROJECT_ROOT_PATH + "/plugin-mapping.properties"), Paths.get(CONNECTORS_PATH, PLUGIN_MAPPING_FILE).toString()); + // wget jar to lib + for (String command : customCommands()) { + try { + master.execInContainer("bash", "-c", command); + } catch (IOException | InterruptedException e) { + LOG.error("exec command:{} error", command, e); + throw new RuntimeException(e); + } + } } private String getResource(String confFile) { diff --git a/seatunnel-e2e/seatunnel-spark-connector-v2-e2e/src/test/java/org/apache/seatunnel/e2e/spark/v2/jdbc/dm/DMSourceTOConsoleIT.java b/seatunnel-e2e/seatunnel-spark-connector-v2-e2e/src/test/java/org/apache/seatunnel/e2e/spark/v2/jdbc/dm/DMSourceTOConsoleIT.java index 4d2ab85700c..bebe110086e 100644 --- a/seatunnel-e2e/seatunnel-spark-connector-v2-e2e/src/test/java/org/apache/seatunnel/e2e/spark/v2/jdbc/dm/DMSourceTOConsoleIT.java +++ b/seatunnel-e2e/seatunnel-spark-connector-v2-e2e/src/test/java/org/apache/seatunnel/e2e/spark/v2/jdbc/dm/DMSourceTOConsoleIT.java @@ -41,6 +41,7 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; +import java.util.List; import java.util.stream.Stream; @Slf4j @@ -58,6 +59,11 @@ public class DMSourceTOConsoleIT extends SparkContainer { private static final int MAX_INIT_RETRY = 10; private static final int MAX_INIT_RETRY_WAIT_TIME = 1000; + @Override + protected List customCommands() { + return Lists.newArrayList("wget -P /opt/bitnami/spark/jars https://repo1.maven.org/maven2/com/dameng/DmJdbcDriver18/8.1.2.141/DmJdbcDriver18-8.1.2.141.jar"); + } + @BeforeAll static void beforeAll() { try {