Failsafe tests results in sonar

☆樱花仙子☆ 提交于 2019-12-30 02:01:05

问题


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 ?


回答1:


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.




回答2:


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)



来源:https://stackoverflow.com/questions/15496856/failsafe-tests-results-in-sonar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!