Skip to content

Commit

Permalink
dm e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
laglangyue committed Aug 31, 2022
1 parent 8e6bf12 commit df5ae70
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ public abstract class SparkContainer {

private static final int WAIT_SPARK_JOB_SUBMIT = 5000;

protected static List<String> DRIVER_FROM_HTTP = new ArrayList<>();
protected List<String> customCommands() {
return new ArrayList<>();
}

@BeforeEach
public void before() {
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<String> 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 {
Expand Down

0 comments on commit df5ae70

Please sign in to comment.