Skip to content

Commit 57413b5

Browse files
committed
[#1711] Start container only if requested
Not everybody has docker installed and we need to make sure that it's still possible to run the full build when there is a remote database already started.
1 parent 29c518e commit 57413b5

File tree

4 files changed

+7
-16
lines changed

4 files changed

+7
-16
lines changed

integration-tests/techempower-postgres-it/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ tasks.withType( Test ).configureEach {
5858

5959
// We need a to use an instance of PostgreSQL with a specific configuration.
6060
// So, for this particular integration-test module, we default to true unless docker is disabled.
61-
systemProperty 'docker', project.properties['docker'] ?: true
61+
systemProperty 'docker', project.hasProperty('docker')
6262
systemProperty 'org.hibernate.reactive.common.InternalStateAssertions.ENFORCE', 'true'
6363

6464
if ( project.hasProperty( 'includeTests' ) ) {

integration-tests/techempower-postgres-it/src/main/java/org/hibernate/reactive/it/techempower/VertxServer.java

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,12 @@ public class VertxServer {
3636
private static final Log LOG = make( Log.class, lookup() );
3737

3838
// These properties are in DatabaseConfiguration in core
39-
public static final boolean USE_DOCKER = isDockerEnabled();
40-
41-
// If not specify, default to enable docker
42-
private static boolean isDockerEnabled() {
43-
String enableDocker = System.getProperty( "docker" );
44-
if ( enableDocker == null ) {
45-
return true;
46-
}
47-
return Boolean.parseBoolean( enableDocker );
48-
}
39+
public static final boolean USE_DOCKER = Boolean.getBoolean( "docker" );
4940

5041
public static final String IMAGE_NAME = "postgres:15-bullseye";
51-
public static final String USERNAME = "benchmarkdbuser";
52-
public static final String PASSWORD = "benchmarkdbpass";
53-
public static final String DB_NAME = "hello_world";
42+
public static final String USERNAME = "hreact";
43+
public static final String PASSWORD = "hreact";
44+
public static final String DB_NAME = "hreact";
5445

5546
public static final int VERTICLE_INSTANCES = 10;
5647

integration-tests/verticle-postgres-it/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ tasks.withType( Test ).configureEach {
5555
displayGranularity = 1
5656
events = ['PASSED', 'FAILED', 'SKIPPED']
5757
}
58-
systemProperty 'docker', project.hasProperty( 'docker' ) ? 'true' : 'false'
58+
systemProperty 'docker', project.hasProperty( 'docker' )
5959
systemProperty 'org.hibernate.reactive.common.InternalStateAssertions.ENFORCE', 'true'
6060

6161
if ( project.hasProperty( 'includeTests' ) ) {

integration-tests/verticle-postgres-it/src/main/java/org/hibernate/reactive/it/verticle/VertxServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class VertxServer {
3434
private static final Log LOG = make( Log.class, lookup() );
3535

3636
// These properties are in DatabaseConfiguration in core
37-
public static final boolean USE_DOCKER = true;
37+
public static final boolean USE_DOCKER = Boolean.getBoolean( "docker" );
3838

3939
public static final String IMAGE_NAME = "postgres:15.2";
4040
public static final String USERNAME = "hreact";

0 commit comments

Comments
 (0)