Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failsafe tests results in sonar

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 coverage test results

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 ?

like image 219
gontard Avatar asked Mar 19 '13 10:03

gontard


2 Answers

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.

enter image description here

like image 140
gontard Avatar answered Nov 01 '22 09:11

gontard


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)

like image 27
Fabrice - SonarSource Team Avatar answered Nov 01 '22 09:11

Fabrice - SonarSource Team