We have a multimodule project which has 4 module All IntegrationTest cases are written in a separate module which has no source code only src/test/java folder. All UnitTest are written in other 2 module inside src/test/java 4th module has responsibility to aggregate the report from all 3 module (2 modules that have Unit test and one module that has integration test) Currently we are getting coverage from UnitTest only We want to include coverage from Integration test as well SonarQube Version: * Community Edition* v10.6 (92116) Jacoco Version:0.8.11 We are using following plugin for Unit test
`<plugin>
<groupId>.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>`
`
.jacoco jacoco-maven-plugin 0.8.11 prepare-agent prepare-agent For Unit test we are using surefire plugin 3.0.0-M5 For Integration test we are fail-safe plugin 2.22.2
`<plugin>
<groupId>.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<id>prepare-agent-integration</id>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
</execution>
</executions>
</plugin>`
.jacoco jacoco-maven-plugin 0.8.11 prepare-agent-integration prepare-agent-integration Aggregator module plugin
`<plugin>
<groupId>.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<id>report-aggregate</id>
<phase>verify</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
` We are able to see three files 2 files from Unit test jacoco.exec 1 file from jacoco-it.exec from integration test module Aggregator is aggregating all three exec but somehow we are not able to see code coverage from Integration module. Even if we remove jacoco-it.exec there is no change in code coverage percentage. We also tried importing jacoco-it.exec in IntellijIdea editor but it show no coverage. Following are the maven logs:
[INFO] — jacoco:0.8.11:report-aggregate (report-aggregate) @ jacoco-aggregate-report —
[INFO] Loading execution data file /Users/xyz/Documents/GitHub/geoff/target/jacoco.exec
[INFO] Loading execution data file /Users/xyz/Documents/GitHub/service/target/jacoco.exec
[INFO] Loading execution data file /Users/xyz/Documents/GitHub/integration-test/target/jacoco-it.exec
I am able to generate Unit test coverage but coverage doesn't include Integration test
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744212429a4563398.html
评论列表(0条)