Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.

Commit 424aecf

Browse files
committed
FAB-4239 JaCoCo for test coverage
Phase 2 do merge on reports. Exclude proto generated files. Start by adding to pom.xml needs more tuning. Change-Id: Ic034199526aebd109a345b06c64b75555d072589 Signed-off-by: rickr <cr22rc@gmail.com>
1 parent fd04683 commit 424aecf

File tree

1 file changed

+41
-3
lines changed

1 file changed

+41
-3
lines changed

pom.xml

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@
226226
<artifactId>maven-failsafe-plugin</artifactId>
227227
<version>2.19.1</version>
228228
<configuration>
229-
<argLine>${surefireArgLine}</argLine>
229+
<argLine>${failsafeArgLine}</argLine>
230230
<includes>
231231
<include>**/IntegrationSuite.java</include>
232232
</includes>
@@ -316,6 +316,11 @@
316316
<groupId>org.jacoco</groupId>
317317
<artifactId>jacoco-maven-plugin</artifactId>
318318
<version>${jacoco.version}</version>
319+
<configuration>
320+
<excludes>
321+
<exclude>**/org/hyperledger/fabric/protos/**</exclude>
322+
</excludes>
323+
</configuration>
319324
<executions>
320325
<execution>
321326
<id>default-prepare-agent</id>
@@ -340,13 +345,14 @@
340345
<goal>prepare-agent</goal>
341346
</goals>
342347
<configuration>
348+
<propertyName>surefireArgLine</propertyName>
343349
<!-- Sets the path to the file which contains the execution data. -->
344350
<destFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</destFile>
345351
<!--
346352
Sets the name of the property containing the settings
347-
for JaCoCo runtime agent.
353+
for JaCoCo runtime agent.
348354
-->
349-
<propertyName>surefireArgLine</propertyName>
355+
350356
</configuration>
351357
</execution>
352358
<!--
@@ -404,6 +410,38 @@
404410
<outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
405411
</configuration>
406412
</execution>
413+
<execution>
414+
<id>merge-results</id>
415+
<phase>verify</phase>
416+
<goals>
417+
<goal>merge</goal>
418+
</goals>
419+
<configuration>
420+
<fileSets>
421+
<!-- Implementation attribute not needed in Maven 3 -->
422+
<!--<fileSet implementation="org.apache.maven.shared.model.fileset.FileSet">-->
423+
<fileSet>
424+
<directory>${project.build.directory}/coverage-reports</directory>
425+
<includes>
426+
<include>*.exec</include>
427+
</includes>
428+
</fileSet>
429+
</fileSets>
430+
<!-- File containing the merged data -->
431+
<destFile>${project.build.directory}/jacoco-merged/merged.exec</destFile>
432+
</configuration>
433+
</execution>
434+
<execution>
435+
<id>post-merge-report</id>
436+
<phase>verify</phase>
437+
<goals>
438+
<goal>report</goal>
439+
</goals>
440+
<configuration>
441+
<dataFile>${project.build.directory}/jacoco-merged/merged.exec</dataFile>
442+
<outputDirectory>${project.reporting.outputDirectory}/jacoco-aggregate</outputDirectory>
443+
</configuration>
444+
</execution>
407445
</executions>
408446
</plugin>
409447
</plugins>

0 commit comments

Comments
 (0)