故障安全测试导致声纳

时间:2013-03-19 10:24:49

标签: java maven sonarqube

我刚刚分开了单元测试和集成测试。我想将覆盖结果与UT和IT分开。

我关注this tutorial并且它有效(感谢@JohnDobie)。

sonar coverage test results

Sonar显示单独的代码覆盖率结果和单位测试成功(右上角)。但是如何才能在声纳中获得集成测试成功?

2 个答案:

答案 0 :(得分:11)

等待IT执行结果的声纳实施(请参阅@Fabrice answer)。我在this tutorial找到了解决方法。这个想法是:

... 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>

结果并不完美,因为所有测试结果都显示在单元测试小部件中。但我真的不想检查ci服务器中的IT测试结果。我想为我的项目设计一个多功能的仪表板。

enter image description here

答案 1 :(得分:2)

在Sonar中不会推送或显示IT执行结果。

这是我们未来可能会添加的内容,但我们首先关注的是覆盖范围,因为这毕竟是最重要的。 (执行结果通常通过CI服务器上的CI软件进行监控)

相关问题