I have just separated the unit tests and the integration tests. I wanted to separate the coverage results from UT and from IT.
I followed this tutorial and it works (Thanks @JohnDobie).
Sonar displays the separate code coverage results and the unit test success (upper right). But how can i get the integration test success in sonar ?
Awaiting for an implementation in sonar of the IT execution results (see the @Fabrice answer). I have found a workaround in this tutorial. The idea is :
... fool Sonar to show test success for both unit and integration tests together by instructing Failsafe to store its test reports to the same directory as Surefire instead of the default failsafe-reports.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
</configuration>
</plugin>
The result is not perfect because all the tests result are shown in the unit test widget. But i really don't want to check the IT tests results in the ci server. I want an all-in-one dashboard for my project.
IT execution results are not pushed nor displayed in Sonar.
This is something we may add in the future, but we first focused on coverage as this is the most important after all. (execution results are usually monitored via CI software on CI servers)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With