Skip to content

Commit

Permalink
[FLINK-35503] Add support for running Oracle connector unit test on A…
Browse files Browse the repository at this point in the history
…RM architecture (apache#3600)
  • Loading branch information
GOODBOY008 authored Sep 19, 2024
1 parent 4b4b8ea commit a5b666a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.junit.Rule;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testcontainers.DockerClientFactory;
import org.testcontainers.containers.OracleContainer;
import org.testcontainers.containers.output.Slf4jLogConsumer;
import org.testcontainers.lifecycle.Startables;
Expand Down Expand Up @@ -73,7 +74,16 @@ public class OracleSourceTestBase extends TestLogger {

public static final OracleContainer ORACLE_CONTAINER =
new OracleContainer(
DockerImageName.parse("goodboy008/oracle-19.3.0-ee").withTag("non-cdb"))
DockerImageName.parse("goodboy008/oracle-19.3.0-ee")
.withTag(
DockerClientFactory.instance()
.client()
.versionCmd()
.exec()
.getArch()
.equals("amd64")
? "non-cdb"
: "arm-non-cdb"))
.withUsername(CONNECTOR_USER)
.withPassword(CONNECTOR_PWD)
.withDatabaseName(ORACLE_DATABASE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,9 @@ public void testAllDataTypes() throws Throwable {

@Test
public void testSnapshotToStreamingSwitchPendingTransactions() throws Exception {

createAndInitialize("product.sql");

Assume.assumeFalse(parallelismSnapshot);

CompletableFuture<Void> finishFuture = createRecordInserters();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testcontainers.DockerClientFactory;
import org.testcontainers.containers.OracleContainer;
import org.testcontainers.containers.output.Slf4jLogConsumer;
import org.testcontainers.lifecycle.Startables;
Expand Down Expand Up @@ -66,7 +67,17 @@ public void before() {
LOG.info("Starting containers...");

oracle =
new OracleContainer(DockerImageName.parse(ORACLE_IMAGE).withTag("non-cdb"))
new OracleContainer(
DockerImageName.parse(ORACLE_IMAGE)
.withTag(
DockerClientFactory.instance()
.client()
.versionCmd()
.exec()
.getArch()
.equals("amd64")
? "non-cdb"
: "arm-non-cdb"))
.withUsername(CONNECTOR_USER)
.withPassword(CONNECTOR_PWD)
.withDatabaseName(ORACLE_DATABASE)
Expand Down

0 comments on commit a5b666a

Please sign in to comment.