|
99 | 99 | <target>1.8</target>
|
100 | 100 | </configuration>
|
101 | 101 | </plugin>
|
| 102 | + |
| 103 | + <!-- run unit tests --> |
102 | 104 | <plugin>
|
103 | 105 | <artifactId>maven-surefire-plugin</artifactId>
|
104 | 106 | <version>3.0.0-M7</version>
|
105 | 107 | <configuration>
|
| 108 | + <argLine>${surefire.jacoco.args}</argLine> |
106 | 109 | <systemPropertyVariables>
|
107 | 110 | <connectorVersion>${project.version}</connectorVersion>
|
108 | 111 | </systemPropertyVariables>
|
109 | 112 | </configuration>
|
110 | 113 | </plugin>
|
| 114 | + |
| 115 | + <!-- run integration tests --> |
111 | 116 | <plugin>
|
112 | 117 | <artifactId>maven-failsafe-plugin</artifactId>
|
113 | 118 | <version>3.0.0-M7</version>
|
114 | 119 | <configuration>
|
| 120 | + <argLine>${failsafe.jacoco.args}</argLine> |
115 | 121 | <systemPropertyVariables>
|
116 | 122 | <connectorVersion>${project.version}</connectorVersion>
|
117 | 123 | </systemPropertyVariables>
|
|
126 | 132 | </execution>
|
127 | 133 | </executions>
|
128 | 134 | </plugin>
|
| 135 | + |
| 136 | + <!-- build the release jar --> |
129 | 137 | <plugin>
|
130 | 138 | <artifactId>maven-assembly-plugin</artifactId>
|
131 | 139 | <version>3.1.1</version>
|
|
144 | 152 | </configuration>
|
145 | 153 | </plugin>
|
146 | 154 |
|
147 |
| - |
148 | 155 | <!-- add the src/integration folder as a test folder, which lets us keep -->
|
149 | 156 | <!-- tests that have a dependency on testcontainers separate from pure -->
|
150 | 157 | <!-- unit tests with no external dependency -->
|
|
167 | 174 | </execution>
|
168 | 175 | </executions>
|
169 | 176 | </plugin>
|
| 177 | + |
| 178 | + <!-- generate test code coverage report --> |
| 179 | + <plugin> |
| 180 | + <groupId>org.jacoco</groupId> |
| 181 | + <artifactId>jacoco-maven-plugin</artifactId> |
| 182 | + <version>0.8.8</version> |
| 183 | + <executions> |
| 184 | + <execution> |
| 185 | + <id>before-unit-test-execution</id> |
| 186 | + <goals> |
| 187 | + <goal>prepare-agent</goal> |
| 188 | + </goals> |
| 189 | + <configuration> |
| 190 | + <destFile>${project.build.directory}/jacoco-output/jacoco-unit-tests.exec</destFile> |
| 191 | + <propertyName>surefire.jacoco.args</propertyName> |
| 192 | + </configuration> |
| 193 | + </execution> |
| 194 | + <execution> |
| 195 | + <id>after-unit-test-execution</id> |
| 196 | + <phase>test</phase> |
| 197 | + <goals> |
| 198 | + <goal>report</goal> |
| 199 | + </goals> |
| 200 | + <configuration> |
| 201 | + <dataFile>${project.build.directory}/jacoco-output/jacoco-unit-tests.exec</dataFile> |
| 202 | + <outputDirectory>${project.reporting.outputDirectory}/jacoco-unit-test-coverage-report</outputDirectory> |
| 203 | + </configuration> |
| 204 | + </execution> |
| 205 | + <execution> |
| 206 | + <id>before-integration-test-execution</id> |
| 207 | + <phase>pre-integration-test</phase> |
| 208 | + <goals> |
| 209 | + <goal>prepare-agent</goal> |
| 210 | + </goals> |
| 211 | + <configuration> |
| 212 | + <destFile>${project.build.directory}/jacoco-output/jacoco-integration-tests.exec</destFile> |
| 213 | + <propertyName>failsafe.jacoco.args</propertyName> |
| 214 | + </configuration> |
| 215 | + </execution> |
| 216 | + <execution> |
| 217 | + <id>after-integration-test-execution</id> |
| 218 | + <phase>post-integration-test</phase> |
| 219 | + <goals> |
| 220 | + <goal>report</goal> |
| 221 | + </goals> |
| 222 | + <configuration> |
| 223 | + <dataFile>${project.build.directory}/jacoco-output/jacoco-integration-tests.exec</dataFile> |
| 224 | + <outputDirectory>${project.reporting.outputDirectory}/jacoco-integration-test-coverage-report</outputDirectory> |
| 225 | + </configuration> |
| 226 | + </execution> |
| 227 | + <execution> |
| 228 | + <id>merge-unit-and-integration</id> |
| 229 | + <phase>post-integration-test</phase> |
| 230 | + <goals> |
| 231 | + <goal>merge</goal> |
| 232 | + </goals> |
| 233 | + <configuration> |
| 234 | + <fileSets> |
| 235 | + <fileSet> |
| 236 | + <directory>${project.build.directory}/jacoco-output/</directory> |
| 237 | + <includes> |
| 238 | + <include>*.exec</include> |
| 239 | + </includes> |
| 240 | + </fileSet> |
| 241 | + </fileSets> |
| 242 | + <destFile>${project.build.directory}/jacoco-output/merged.exec</destFile> |
| 243 | + </configuration> |
| 244 | + </execution> |
| 245 | + <execution> |
| 246 | + <id>create-merged-report</id> |
| 247 | + <phase>post-integration-test</phase> |
| 248 | + <goals> |
| 249 | + <goal>report</goal> |
| 250 | + </goals> |
| 251 | + <configuration> |
| 252 | + <dataFile>${project.build.directory}/jacoco-output/merged.exec</dataFile> |
| 253 | + <outputDirectory>${project.reporting.outputDirectory}/jacoco-merged-test-coverage-report</outputDirectory> |
| 254 | + </configuration> |
| 255 | + </execution> |
| 256 | + </executions> |
| 257 | + </plugin> |
170 | 258 | </plugins>
|
171 | 259 | </build>
|
172 | 260 | </project>
|
0 commit comments