Skip to content

Commit

Permalink
Remove multiple mounts in MultiTypeMappingTransformationTest for GHA …
Browse files Browse the repository at this point in the history
…support

Signed-off-by: Andre Kurait <[email protected]>
  • Loading branch information
AndreKurait committed Dec 11, 2024
1 parent 33d4e79 commit c5cb306
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.testcontainers.containers.BindMode;

import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.equalTo;
Expand All @@ -31,10 +32,9 @@ class MultiTypeMappingTransformationTest extends BaseMigrationTest {
@Test
public void multiTypeTransformationTest_union() {
try (
final var indexCreatedCluster = new SearchClusterContainer(SearchClusterContainer.ES_V5_6_13)
.withFileSystemBind(localDirectory.getAbsolutePath(), SearchClusterContainer.CLUSTER_SNAPSHOT_DIR);
final var indexCreatedCluster = new SearchClusterContainer(SearchClusterContainer.ES_V5_6_16);
final var upgradedSourceCluster = new SearchClusterContainer(ES_V6_8_23)
.withFileSystemBind(localDirectory.getAbsolutePath(), SearchClusterContainer.CLUSTER_SNAPSHOT_DIR);
.withFileSystemBind(localDirectory.getAbsolutePath(), SearchClusterContainer.CLUSTER_SNAPSHOT_DIR, BindMode.READ_WRITE);
final var targetCluster = new SearchClusterContainer(SearchClusterContainer.OS_V2_14_0)
) {
indexCreatedCluster.start();
Expand All @@ -60,6 +60,8 @@ public void multiTypeTransformationTest_union() {
indexCreatedOperations.createSnapshotRepository(SearchClusterContainer.CLUSTER_SNAPSHOT_DIR, es5Repo);
indexCreatedOperations.takeSnapshot(es5Repo, snapshotName, originalIndexName);

indexCreatedCluster.copySnapshotData(localDirectory.getAbsolutePath());

// Register snapshot repository and restore snapshot in ES 6 cluster
upgradedSourceOperations.createSnapshotRepository(SearchClusterContainer.CLUSTER_SNAPSHOT_DIR, es5Repo);
upgradedSourceOperations.restoreSnapshot(es5Repo, snapshotName);
Expand Down Expand Up @@ -119,7 +121,7 @@ public void multiTypeTransformationTest_union() {
@Test
public void es5_doesNotAllow_multiTypeConflicts() {
try (
final var es5 = new SearchClusterContainer(SearchClusterContainer.ES_V5_6_13)
final var es5 = new SearchClusterContainer(SearchClusterContainer.ES_V5_6_16)
) {
es5.start();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class SearchClusterContainer extends GenericContainer<SearchClusterContai
Version.fromString("ES 6.8.23")
);

public static final ContainerVersion ES_V5_6_13 = new ElasticsearchVersion(
public static final ContainerVersion ES_V5_6_16 = new ElasticsearchVersion(
"docker.elastic.co/elasticsearch/elasticsearch:5.6.16",
Version.fromString("ES 5.6.16")
);
Expand Down Expand Up @@ -83,7 +83,7 @@ public SearchClusterContainer(final ContainerVersion version) {
super(DockerImageName.parse(version.imageName));
this.withExposedPorts(9200, 9300)
.withEnv(version.getInitializationType().getEnvVariables())
.waitingFor(Wait.forHttp("/").forPort(9200).forStatusCode(200).withStartupTimeout(Duration.ofMinutes(5)));
.waitingFor(Wait.forHttp("/").forPort(9200).forStatusCode(200).withStartupTimeout(Duration.ofSeconds(20)));

this.containerVersion = version;
}
Expand Down

0 comments on commit c5cb306

Please sign in to comment.