如何从集成测试中指定 JUnit 结果的路径?

How can I specify the path to JUnit results from integration tests?

所以我知道有 sonar.junit.reportsPath 被 Java 插件读取并使用一个包含 XML 个文件的目录来解析。

但是,如果我没有一个测试结果目录,而是两个,特别是一个用于单元测试,一个用于集成测试,该怎么办?较新版本的 Sonarqube 通过 sonar.jacoco.reportPathsonar.jacoco.itReportPath 获得了对报告这些不同测试结果的覆盖率的一些支持。我还在互联网上找到了一些关于 sonar.junit.itReportsPath 的参考资料,但在官方文档或来源中没有,所以我猜它不受支持。

TL;DR - 我在哪里可以指定集成测试结果的路径?

软件:Sonarqube 5.1.1, Sonarqube-Runner 2.4

此功能不可用。欢迎为 https://jira.sonarsource.com/browse/SONAR-4101

投票

很旧,但以防其他人在搜索解决方案时通过:我最终将 failsafe 插件的输出文件夹更改为 surefire 插件的文件夹。所以这两个测试都在 SQ 中解析和计数。

<!-- write to surefire folder, so sonarqube can fetch and count tests -->
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-failsafe-plugin</artifactId>
    <version>2.22.2</version>
    <configuration>
         <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
    </configuration>
</plugin>