故障安全测试导致声纳

gon*_*ard 15 java maven sonarqube

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

我按照本教程进行操作(感谢@JohnDobie).

声纳覆盖测试结果

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

gon*_*ard 12

等待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>
Run Code Online (Sandbox Code Playgroud)

结果并不完美,因为所有测试结果都显示在单元测试小部件中.但我真的不想检查ci服务器中的IT测试结果.我想为我的项目提供一体化仪表板.

在此输入图像描述