Skip to content

Commit

Permalink
Switch ctest env setup default from 'local' to 'docker'
Browse files Browse the repository at this point in the history
  • Loading branch information
ggivo committed Nov 19, 2024
1 parent 8ece5a3 commit 8374218
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
mvn javadoc:jar
- name: Run tests
run: |
export TEST_ENV_PROVIDER=local
make test
env:
JVM_OPTS: -Xmx3200m
Expand Down
13 changes: 11 additions & 2 deletions src/test/java/redis/clients/jedis/util/TestEnvUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
import java.util.Optional;

public class TestEnvUtil {
private static final String TEST_ENV_PROVIDER = System.getenv().getOrDefault("TEST_ENV_PROVIDER", "");
// Redis servers running inside docker
public static final String ENV_DOCKER = "docker";
// Redis servers running localy on the test host
public static final String ENV_LOCAL = "local";

private static final String TEST_ENV_PROVIDER = System.getenv().getOrDefault("TEST_ENV_PROVIDER", ENV_DOCKER);
private static final String TESTMODULE_SO = Optional.ofNullable(System.getenv("TESTMODULE_SO"))
.orElseGet(() -> isContainerEnv()
? "/redis/work/modules/testmodule.so"
Expand All @@ -14,6 +19,10 @@ public static String testModuleSo() {
}

public static boolean isContainerEnv() {
return TEST_ENV_PROVIDER.equals("docker");
return TEST_ENV_PROVIDER.equals(ENV_DOCKER);
}

public static boolean isLocalEnv() {
return TEST_ENV_PROVIDER.equals(ENV_LOCAL);
}
}

0 comments on commit 8374218

Please sign in to comment.