Skip to content

Commit

Permalink
handle the difference between community and enterprise mountable dire…
Browse files Browse the repository at this point in the history
…ctories in TestUpgrade
  • Loading branch information
Andrew Jefferson committed Jun 22, 2020
1 parent ea936c4 commit 92b0c48
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/test/java/com/neo4j/docker/TestUpgrade.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.testcontainers.containers.output.Slf4jLogConsumer;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.images.PullPolicy;
import org.testcontainers.shaded.com.google.common.collect.ImmutableList;

import java.io.File;
import java.io.FileWriter;
Expand All @@ -27,6 +26,8 @@
import java.nio.file.Path;
import java.time.Duration;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -40,8 +41,9 @@
public class TestUpgrade
{
private static final Logger log = LoggerFactory.getLogger( TestUpgrade.class );
ImmutableList<String> readonlyMounts = ImmutableList.of( "conf" );
ImmutableList<String> writableMounts = ImmutableList.of( "data", "logs", "metrics" );
private static final List<String> readonlyMounts = Collections.singletonList( "conf" );
private static final List<String> writableMounts = getWriteableMounts();

private final String user = "neo4j";
private final String password = "quality";

Expand Down Expand Up @@ -297,4 +299,18 @@ private static String releaseImageName( int major, int minor )
return String.format( "neo4j:%d.%d%s", major, minor,
(TestSettings.EDITION == TestSettings.Edition.ENTERPRISE) ? "-enterprise" : "" );
}

private static List<String> getWriteableMounts()
{
switch ( TestSettings.EDITION )
{
case COMMUNITY:
return Arrays.asList( "data", "logs" );
case ENTERPRISE:
return Arrays.asList( "data", "logs", "metrics" );
default:
Assertions.fail( "Unknown Edition: " + TestSettings.EDITION );
return Collections.emptyList();
}
}
}

0 comments on commit 92b0c48

Please sign in to comment.