故障安全测试导致声纳

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

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

声纳覆盖测试结果

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

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

  org.apache.maven.plugins maven-failsafe-plugin  ${project.build.directory}/surefire-reports   

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

在此处输入图像描述

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

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