15

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

我按照本教程进行操作,并且可以正常工作(感谢@JohnDobie)。

声纳覆盖测试结果

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

4

2 回答 2

13

等待 IT 执行结果的声纳实施(请参阅@Fabrice 答案)。我在本教程中找到了解决方法。这个想法是:

... 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 测试结果。我想要一个用于我的项目的一体化仪表板。

在此处输入图像描述

于 2013-03-22T10:14:44.900 回答
2

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

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

于 2013-03-19T12:39:48.043 回答