Skip to content

Commit

Permalink
trying to make CI work by using themp dir instead fo classdir
Browse files Browse the repository at this point in the history
  • Loading branch information
dlg99 committed Jun 26, 2024
1 parent ac2aef5 commit a745071
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,18 @@ private PulsarCluster(PulsarClusterSpec spec, CSContainer csContainer, boolean s
}
));

spec.volumeMounts.forEach((key, value) -> {
if (zkContainer != null) {
zkContainer.withFileSystemBind(key, value, BindMode.READ_WRITE);
}
csContainer.withFileSystemBind(key, value, BindMode.READ_WRITE);
proxyContainer.withFileSystemBind(key, value, BindMode.READ_WRITE);

bookieContainers.values().forEach(c -> c.withFileSystemBind(key, value, BindMode.READ_WRITE));
brokerContainers.values().forEach(c -> c.withFileSystemBind(key, value, BindMode.READ_WRITE));
workerContainers.values().forEach(c -> c.withFileSystemBind(key, value, BindMode.READ_WRITE));
});

spec.classPathVolumeMounts.forEach((key, value) -> {
if (zkContainer != null) {
zkContainer.withClasspathResourceMapping(key, value, BindMode.READ_WRITE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ public class PulsarClusterSpec {
@Builder.Default
Map<String, String> classPathVolumeMounts = new TreeMap<>();

/**
* Provide a map of paths to mount as volumes inside the containers
*/
@Builder.Default
Map<String, String> volumeMounts = new TreeMap<>();

/**
* Pulsar Test Image Name
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
import org.apache.pulsar.tests.integration.topologies.PulsarClusterSpec;
import org.apache.pulsar.tests.integration.topologies.PulsarClusterTestBase;
import org.testng.annotations.Test;

import java.nio.file.Files;
import java.nio.file.Path;
import java.util.stream.Stream;
import static java.util.stream.Collectors.joining;
import static org.testng.Assert.assertEquals;
Expand All @@ -45,12 +48,16 @@ public class PulsarUpgradeDowngradeTest extends PulsarClusterTestBase {

@Test(timeOut=600_000)
public void test_210() throws Exception {
testUpgradeDowngrade("pulsar2.10-upgrade", "apachepulsar/pulsar:2.10.0", PulsarContainer.DEFAULT_IMAGE_NAME);
Path tempDir = Files.createTempDirectory("pulsar2.10");
tempDir.toFile().deleteOnExit();
testUpgradeDowngrade(tempDir.toAbsolutePath().toString(), "apachepulsar/pulsar:2.10.0", PulsarContainer.DEFAULT_IMAGE_NAME);

Check failure on line 53 in tests/integration/src/test/java/org/apache/pulsar/tests/integration/upgrade/PulsarUpgradeDowngradeTest.java

View workflow job for this annotation

GitHub Actions / CI - Integration - Upgrade

PulsarUpgradeDowngradeTest.test_210

Container startup failed for image apachepulsar/java-test-image:latest
}

@Test(timeOut=600_000)
public void test_300() throws Exception {
testUpgradeDowngrade("pulsar3.0-upgrade", "apachepulsar/pulsar:3.0.5", PulsarContainer.DEFAULT_IMAGE_NAME);
Path tempDir = Files.createTempDirectory("pulsar3.0");
tempDir.toFile().deleteOnExit();
testUpgradeDowngrade(tempDir.toAbsolutePath().toString(), "apachepulsar/pulsar:3.0.5", PulsarContainer.DEFAULT_IMAGE_NAME);
}

private void testUpgradeDowngrade(String path, String imageOld, String imageNew) throws Exception {
Expand All @@ -63,7 +70,7 @@ private void testUpgradeDowngrade(String path, String imageOld, String imageNew)
.numBookies(2)
.numBrokers(1)
.clusterName(clusterName)
.classPathVolumeMounts(
.volumeMounts(
ImmutableMap.<String, String> builder()
.put(path, "/pulsar/data")
.build())
Expand All @@ -74,7 +81,7 @@ ImmutableMap.<String, String> builder()
.numBookies(2)
.numBrokers(1)
.clusterName(clusterName)
.classPathVolumeMounts(
.volumeMounts(
ImmutableMap.<String, String> builder()
.put(path, "/pulsar/data")
.build())
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit a745071

Please sign in to comment.