I had configured Jacoco + Sonar in Maven. I am able to generate the coverage reports for unit tests & display the coverage in Sonar as well. But, unable to generate the reports for integration tests. "jacoco-it.exec" is generated but, when I go and open the index.html, it looks empty. But, there are many integration tests got executed & passed as well. In jacoco-sessions.html, it is clearly mentioned about all the classes which are used internally. Please help me if you have any idea what is wrong in the below code wrt integration tests. I have configured Sonar also properly & given the path to pick up the results for integrations tests. Please see once and help me if you have any idea. pom.xml:
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<destFile>${project.build.directory}/coverage-reports/jacoco-it.exec</destFile>
<dataFile>${project.build.directory}/coverage-reports/jacoco-it.exec</dataFile>
</configuration>
<executions>
<execution>
<id>pre-integration-test</id
<phase>pre-integration-test</phase>
<goals>
<goal>prepare-agent</goal>
</goals> </execution>
<execution>
<id>post-integration-test</id>
<phase>post-integration-test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<systemPropertyVariables>
<jacoco-agent.destfile>${project.build.directory}/coverage-reports/jacoco-it.exec</jacoco-agent.destfile>
</systemPropertyVariables>
<encoding>UTF-8</encoding>
<skipTests>false</skipTests>
<runOrder>alphabetical</runOrder>
<includes>
....<There are integration tests>
</includes>
<excludes>
....
</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
636 次 |
| 最近记录: |