Skip to content

Commit

Permalink
FAB-4239 JaCoCo for test coverage
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
cr22rc committed May 31, 2017
1 parent fd04683 commit 424aecf
Showing 1 changed file with 41 additions and 3 deletions.
44 changes: 41 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<argLine>${surefireArgLine}</argLine>
<argLine>${failsafeArgLine}</argLine>
<includes>
<include>**/IntegrationSuite.java</include>
</includes>
Expand Down Expand Up @@ -316,6 +316,11 @@
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<configuration>
<excludes>
<exclude>**/org/hyperledger/fabric/protos/**</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
Expand All @@ -340,13 +345,14 @@
<goal>prepare-agent</goal>
</goals>
<configuration>
<propertyName>surefireArgLine</propertyName>
<!-- Sets the path to the file which contains the execution data. -->
<destFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</destFile>
<!--
Sets the name of the property containing the settings
for JaCoCo runtime agent.
for JaCoCo runtime agent.
-->
<propertyName>surefireArgLine</propertyName>

</configuration>
</execution>
<!--
Expand Down Expand Up @@ -404,6 +410,38 @@
<outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
</configuration>
</execution>
<execution>
<id>merge-results</id>
<phase>verify</phase>
<goals>
<goal>merge</goal>
</goals>
<configuration>
<fileSets>
<!-- Implementation attribute not needed in Maven 3 -->
<!--<fileSet implementation="org.apache.maven.shared.model.fileset.FileSet">-->
<fileSet>
<directory>${project.build.directory}/coverage-reports</directory>
<includes>
<include>*.exec</include>
</includes>
</fileSet>
</fileSets>
<!-- File containing the merged data -->
<destFile>${project.build.directory}/jacoco-merged/merged.exec</destFile>
</configuration>
</execution>
<execution>
<id>post-merge-report</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<dataFile>${project.build.directory}/jacoco-merged/merged.exec</dataFile>
<outputDirectory>${project.reporting.outputDirectory}/jacoco-aggregate</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Expand Down

0 comments on commit 424aecf

Please sign in to comment.