Skip to content

Commit

Permalink
Tests should (optionally) fail if container env not available
Browse files Browse the repository at this point in the history
Add sys prop check to determine whether to fail hard
  • Loading branch information
jasondlee committed Nov 15, 2024
1 parent a4c67c5 commit f405b26
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ public void createContainer(@Observes(precedence = 500) BeforeClass beforeClass)
final DockerRequired dockerRequired = javaClass.getAnnotation(DockerRequired.class);
if (dockerRequired != null) {
if (!isDockerAvailable()) {
throw createException(dockerRequired.value());
// TODO Discuss non-WildFly options
if ("true".equals(System.getProperty("org.wildfly.test.require.docker")) ||
"true".equals(System.getProperty("arquillian.testcontainers.require.docker"))) {
throw new RuntimeException("Docker is required but it is not available or is not properly configured");
} else {
throw createException(dockerRequired.value());
}

}
}
final TestcontainerRegistry instances = new TestcontainerRegistry();
Expand Down

0 comments on commit f405b26

Please sign in to comment.