File tree Expand file tree Collapse file tree 7 files changed +34
-29
lines changed
driver/src/test/java/org/neo4j/driver
examples/src/test/java/org/neo4j/docs/driver Expand file tree Collapse file tree 7 files changed +34
-29
lines changed Original file line number Diff line number Diff line change 2222import java .util .Arrays ;
2323import java .util .List ;
2424import java .util .concurrent .atomic .AtomicInteger ;
25+ import org .junit .jupiter .api .condition .DisabledIfSystemProperty ;
2526import org .junit .jupiter .api .extension .RegisterExtension ;
2627import org .neo4j .driver .AuthToken ;
2728import org .neo4j .driver .Config ;
2829import org .neo4j .driver .exceptions .SessionExpiredException ;
2930import org .neo4j .driver .testutil .cc .LocalOrRemoteClusterExtension ;
30- import org .testcontainers .junit .jupiter .Testcontainers ;
3131
32- @ Testcontainers ( disabledWithoutDocker = true )
32+ @ DisabledIfSystemProperty ( named = "skipDockerTests" , matches = "^ true$" )
3333class CausalClusteringStressIT extends AbstractStressTestBase <CausalClusteringStressIT .Context > {
3434 @ RegisterExtension
3535 static final LocalOrRemoteClusterExtension clusterRule = new LocalOrRemoteClusterExtension ();
Original file line number Diff line number Diff line change 2020
2121import org .neo4j .driver .Driver ;
2222import org .neo4j .driver .GraphDatabase ;
23- import org .testcontainers .DockerClientFactory ;
2423import org .testcontainers .containers .Neo4jContainer ;
2524import org .testng .SkipException ;
2625
@@ -39,18 +38,10 @@ public Driver getDriver() {
3938 return GraphDatabase .driver (NEO4J .getBoltUrl ());
4039 }
4140
42- public void skipIfDockerUnavailable () {
43- if (!isDockerAvailable ()) {
41+ public void skipIfDockerTestsSkipped () {
42+ var skip = System .getProperty ("skipDockerTests" );
43+ if (skip != null && skip .equals (Boolean .TRUE .toString ())) {
4444 throw new SkipException ("Docker is unavailable" );
4545 }
4646 }
47-
48- private boolean isDockerAvailable () {
49- try {
50- DockerClientFactory .instance ().client ();
51- return true ;
52- } catch (Throwable ex ) {
53- return false ;
54- }
55- }
5647}
Original file line number Diff line number Diff line change 2727import org .reactivestreams .Publisher ;
2828import org .reactivestreams .tck .PublisherVerification ;
2929import org .reactivestreams .tck .TestEnvironment ;
30- import org .testcontainers .junit .jupiter .Testcontainers ;
3130import org .testng .annotations .AfterClass ;
3231import org .testng .annotations .BeforeClass ;
3332import reactor .core .publisher .Mono ;
3433
35- @ Testcontainers (disabledWithoutDocker = true )
3634public class ReactiveResultPublisherVerificationIT extends PublisherVerification <ReactiveResult > {
3735 private final Neo4jManager NEO4J = new Neo4jManager ();
3836 private static final Duration TIMEOUT = Duration .ofSeconds (10 );
@@ -49,7 +47,7 @@ public ReactiveResultPublisherVerificationIT() {
4947
5048 @ BeforeClass
5149 public void beforeClass () {
52- NEO4J .skipIfDockerUnavailable ();
50+ NEO4J .skipIfDockerTestsSkipped ();
5351 NEO4J .start ();
5452 driver = NEO4J .getDriver ();
5553 }
Original file line number Diff line number Diff line change 2828import org .reactivestreams .Publisher ;
2929import org .reactivestreams .tck .PublisherVerification ;
3030import org .reactivestreams .tck .TestEnvironment ;
31- import org .testcontainers .junit .jupiter .Testcontainers ;
3231import org .testng .annotations .AfterClass ;
3332import org .testng .annotations .BeforeClass ;
3433import reactor .core .publisher .Flux ;
3534import reactor .core .publisher .Mono ;
3635
37- @ Testcontainers (disabledWithoutDocker = true )
3836public class ReactiveResultRecordPublisherVerificationIT extends PublisherVerification <Record > {
3937 private final Neo4jManager NEO4J = new Neo4jManager ();
4038 private static final long MAX_NUMBER_OF_RECORDS = 30000 ;
@@ -55,7 +53,7 @@ public ReactiveResultRecordPublisherVerificationIT() {
5553
5654 @ BeforeClass
5755 public void beforeClass () {
58- NEO4J .skipIfDockerUnavailable ();
56+ NEO4J .skipIfDockerTestsSkipped ();
5957 NEO4J .start ();
6058 driver = NEO4J .getDriver ();
6159 }
Original file line number Diff line number Diff line change 2828import org .reactivestreams .Publisher ;
2929import org .reactivestreams .tck .PublisherVerification ;
3030import org .reactivestreams .tck .TestEnvironment ;
31- import org .testcontainers .junit .jupiter .Testcontainers ;
3231import org .testng .annotations .AfterClass ;
3332import org .testng .annotations .BeforeClass ;
3433
35- @ Testcontainers (disabledWithoutDocker = true )
3634@ SuppressWarnings ("deprecation" )
3735public class RxResultRecordPublisherVerificationIT extends PublisherVerification <Record > {
3836 private final Neo4jManager NEO4J = new Neo4jManager ();
@@ -54,7 +52,7 @@ public RxResultRecordPublisherVerificationIT() {
5452
5553 @ BeforeClass
5654 public void beforeClass () {
57- NEO4J .skipIfDockerUnavailable ();
55+ NEO4J .skipIfDockerTestsSkipped ();
5856 NEO4J .start ();
5957 driver = NEO4J .getDriver ();
6058 }
Original file line number Diff line number Diff line change 1818 */
1919package org .neo4j .docs .driver ;
2020
21- import static org .junit .jupiter .api .Assertions .assertTrue ;
22-
23- import java .net .URI ;
24- import java .util .Optional ;
2521import org .junit .jupiter .api .Test ;
22+ import org .junit .jupiter .api .condition .DisabledIfSystemProperty ;
2623import org .neo4j .driver .AuthTokens ;
2724import org .neo4j .driver .net .ServerAddress ;
2825import org .testcontainers .containers .Neo4jContainer ;
2926import org .testcontainers .junit .jupiter .Container ;
30- import org .testcontainers .junit .jupiter .Testcontainers ;
3127
32- @ Testcontainers (disabledWithoutDocker = true )
28+ import java .net .URI ;
29+ import java .util .Optional ;
30+
31+ import static org .junit .jupiter .api .Assertions .assertTrue ;
32+
33+ @ DisabledIfSystemProperty (named = "skipDockerTests" , matches = "^true$" )
3334class RoutingExamplesIT {
3435 private static final String NEO4J_VERSION =
3536 Optional .ofNullable (System .getenv ("NEO4J_VERSION" )).orElse ("4.4" );
Original file line number Diff line number Diff line change 261261 <parallelizable .it.forkCount>1</parallelizable .it.forkCount>
262262 </properties >
263263 </profile >
264+
265+ <profile >
266+ <id >skip-docker-tests</id >
267+ <build >
268+ <pluginManagement >
269+ <plugins >
270+ <plugin >
271+ <groupId >org.apache.maven.plugins</groupId >
272+ <artifactId >maven-failsafe-plugin</artifactId >
273+ <configuration >
274+ <systemPropertyVariables >
275+ <skipDockerTests >true</skipDockerTests >
276+ </systemPropertyVariables >
277+ </configuration >
278+ </plugin >
279+ </plugins >
280+ </pluginManagement >
281+ </build >
282+ </profile >
264283 </profiles >
265284
266285 <build >
You can’t perform that action at this time.
0 commit comments