|
| 1 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 2 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 |
| 3 | + http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| 4 | + <modelVersion>4.0.0</modelVersion> |
| 5 | + |
| 6 | + <parent> |
| 7 | + <groupId>org.neo4j.driver</groupId> |
| 8 | + <artifactId>neo4j-java-driver-parent</artifactId> |
| 9 | + <version>4.3-SNAPSHOT</version> |
| 10 | + <relativePath>..</relativePath> |
| 11 | + </parent> |
| 12 | + |
| 13 | + <artifactId>testkit-tests</artifactId> |
| 14 | + |
| 15 | + <name>Neo4j Java Driver Testkit Tests</name> |
| 16 | + <description>Tests this driver using Testkit.</description> |
| 17 | + |
| 18 | + <properties> |
| 19 | + <rootDir>${project.basedir}/..</rootDir> |
| 20 | + |
| 21 | + <testkit.version>4.3</testkit.version> |
| 22 | + <!-- See the testkit-custom-args profile if you want to customize this on individual runs. --> |
| 23 | + <testkit.args>--tests TESTKIT_TESTS INTEGRATION_TESTS STUB_TESTS STRESS_TESTS TLS_TESTS</testkit.args> |
| 24 | + <testkit.timeout>7200000</testkit.timeout> |
| 25 | + |
| 26 | + <docker-maven-plugin.version>0.36.1</docker-maven-plugin.version> |
| 27 | + <docker.showLogs>true</docker.showLogs> |
| 28 | + </properties> |
| 29 | + |
| 30 | + <build> |
| 31 | + <plugins> |
| 32 | + <plugin> |
| 33 | + <groupId>io.fabric8</groupId> |
| 34 | + <artifactId>docker-maven-plugin</artifactId> |
| 35 | + </plugin> |
| 36 | + </plugins> |
| 37 | + |
| 38 | + <pluginManagement> |
| 39 | + <plugins> |
| 40 | + <plugin> |
| 41 | + <groupId>io.fabric8</groupId> |
| 42 | + <artifactId>docker-maven-plugin</artifactId> |
| 43 | + <version>${docker-maven-plugin.version}</version> |
| 44 | + |
| 45 | + <configuration> |
| 46 | + <images> |
| 47 | + <image> |
| 48 | + <name>testkit-launcher:%v</name> |
| 49 | + |
| 50 | + <build> |
| 51 | + <contextDir>${project.basedir}/src/main/docker</contextDir> |
| 52 | + </build> |
| 53 | + |
| 54 | + <run> |
| 55 | + <!-- |
| 56 | + A sanitized version of the image’s short name from which this container is created. |
| 57 | + As this Maven plugin does not currently remove Docker containers when Maven build is interrupted, |
| 58 | + a unique name should prevent running multiple concurrent builds. |
| 59 | + --> |
| 60 | + <containerNamePattern>%n</containerNamePattern> |
| 61 | + <wait> |
| 62 | + <exit>0</exit> |
| 63 | + <time>${testkit.timeout}</time> |
| 64 | + </wait> |
| 65 | + <env> |
| 66 | + <TESTKIT_CHECKOUT_PATH>${project.build.directory}/testkit</TESTKIT_CHECKOUT_PATH> |
| 67 | + <TESTKIT_VERSION>${testkit.version}</TESTKIT_VERSION> |
| 68 | + <TESTKIT_ARGS>${testkit.args}</TESTKIT_ARGS> |
| 69 | + <TEST_DRIVER_NAME>java</TEST_DRIVER_NAME> |
| 70 | + <TEST_DRIVER_REPO>${rootDir}</TEST_DRIVER_REPO> |
| 71 | + <TEST_SKIP_BUILD>true</TEST_SKIP_BUILD> |
| 72 | + </env> |
| 73 | + <volumes> |
| 74 | + <bind> |
| 75 | + <!-- |
| 76 | + Testkit requires access to Docker to launch other containers. |
| 77 | + This is achieved by passing through the host's Docker socket. |
| 78 | + --> |
| 79 | + <volume>/var/run/docker.sock:/var/run/docker.sock</volume> |
| 80 | + <!-- |
| 81 | + Testkit launches other containers and shares sources with them via volumes. |
| 82 | + Given that Testkit runs in the container and uses the host's Docker instance, |
| 83 | + the filesystem paths it uses must exist on the host system. |
| 84 | + This is achieved by using the same path as on the host system. |
| 85 | + --> |
| 86 | + <volume>${rootDir}:${rootDir}</volume> |
| 87 | + </bind> |
| 88 | + </volumes> |
| 89 | + </run> |
| 90 | + </image> |
| 91 | + </images> |
| 92 | + </configuration> |
| 93 | + |
| 94 | + <executions> |
| 95 | + <execution> |
| 96 | + <id>build-testkit-launcher</id> |
| 97 | + <phase>pre-integration-test</phase> |
| 98 | + <goals> |
| 99 | + <goal>build</goal> |
| 100 | + </goals> |
| 101 | + </execution> |
| 102 | + <execution> |
| 103 | + <id>run-testkit</id> |
| 104 | + <phase>integration-test</phase> |
| 105 | + <goals> |
| 106 | + <!-- Testkit is expected to exit automatically. --> |
| 107 | + <goal>start</goal> |
| 108 | + </goals> |
| 109 | + </execution> |
| 110 | + </executions> |
| 111 | + </plugin> |
| 112 | + </plugins> |
| 113 | + </pluginManagement> |
| 114 | + </build> |
| 115 | + |
| 116 | + <profiles> |
| 117 | + <!-- Skips running Testkit when tests are skipped. --> |
| 118 | + <profile> |
| 119 | + <id>skip-testkit</id> |
| 120 | + <activation> |
| 121 | + <property> |
| 122 | + <name>skipTests</name> |
| 123 | + </property> |
| 124 | + </activation> |
| 125 | + <properties> |
| 126 | + <docker.skip>true</docker.skip> |
| 127 | + </properties> |
| 128 | + </profile> |
| 129 | + <!-- Skips running Testkit in TeamCity as it is launched separately. --> |
| 130 | + <profile> |
| 131 | + <id>skip-testkit-teamcity</id> |
| 132 | + <activation> |
| 133 | + <property> |
| 134 | + <name>env.TEAMCITY_VERSION</name> |
| 135 | + </property> |
| 136 | + </activation> |
| 137 | + <properties> |
| 138 | + <docker.skip>true</docker.skip> |
| 139 | + </properties> |
| 140 | + </profile> |
| 141 | + <!-- |
| 142 | + Enables running Testkit when other tests are skipped. |
| 143 | + Usage example: mvn clean verify -DskipTests -P testkit-tests |
| 144 | + --> |
| 145 | + <profile> |
| 146 | + <id>testkit-tests</id> |
| 147 | + <properties> |
| 148 | + <docker.skip>false</docker.skip> |
| 149 | + </properties> |
| 150 | + </profile> |
| 151 | + <!-- |
| 152 | + Enables passing custom arguments to Testkit and also enables running Testkit when other tests are skipped. |
| 153 | + Usage example: mvn clean verify -DskipTests -DtestkitArgs='args' (for instance, you can run stub tests only by setting the tests argument to STUB_TESTS) |
| 154 | + --> |
| 155 | + <profile> |
| 156 | + <id>testkit-custom-args</id> |
| 157 | + <activation> |
| 158 | + <property> |
| 159 | + <name>testkitArgs</name> |
| 160 | + </property> |
| 161 | + </activation> |
| 162 | + <properties> |
| 163 | + <docker.skip>false</docker.skip> |
| 164 | + <testkit.args>${testkitArgs}</testkit.args> |
| 165 | + </properties> |
| 166 | + </profile> |
| 167 | + <!-- |
| 168 | + Enables docker maven plugin verbose output. |
| 169 | + For instance, this can be useful for checking build logs. |
| 170 | + --> |
| 171 | + <profile> |
| 172 | + <id>testkit-docker-verbose</id> |
| 173 | + <properties> |
| 174 | + <docker.verbose>true</docker.verbose> |
| 175 | + </properties> |
| 176 | + </profile> |
| 177 | + </profiles> |
| 178 | +</project> |
0 commit comments