【问题标题】:Test Automation Execution reports in SonarQubeSonarQube 中的测试自动化执行报告
【发布时间】:2017-08-14 12:33:43
【问题描述】:

我对 Sonar Qube 了解不多。这是关于使用 SonarQube 的测试自动化报告。 基本上,我们在 Sonar 中有不同语言的代码覆盖率和质量门报告。但是,是否可以将一个简单的通过/失败报告集成到其中,输入为 xml? 我们有一个通用的 SonarQube 仪表板,用于覆盖范围、质量代码门等,并希望将其用作测试报告仪表板。目前,我们正在使用 UI 自动化工具“Froglogic Squish”(带有 Python 脚本)进行测试自动化,它以 html 格式提供报告,并为此生成格式良好的 xml。

我的问题首先是,Junit 格式的 xmls 通过/失败报告是否可以出现在 SonarQube 上,如果是,那么我们可以将 Squish 报告 xml 转换为 Junit 格式的 xml,并且可以直接由某些人使用Sonar Qube 中的插件,用于在仪表板中显示报告。

(当我使用 Sonar Java 运行 Sonar 时,请在 Jenkins 的控制台输出下方找到 用于 Junit 报告)

INFO: Sensor XmlFileSensor
INFO: 1 source files to be analyzed
INFO: Sensor XmlFileSensor (done) | time=154ms
INFO: Sensor Zero Coverage Sensor
INFO: 1/1 source files have been analyzed
INFO: Sensor Zero Coverage Sensor (done) | time=134ms
INFO: Sensor Code Colorizer Sensor
INFO: Sensor Code Colorizer Sensor (done) | time=50ms
INFO: Sensor CPD Block Indexer
INFO: Sensor CPD Block Indexer (done) | time=0ms
INFO: Calculating CPD for 0 files
INFO: CPD calculation finished
INFO: Analysis report generated in 5475ms, dir size=54 MB
INFO: Analysis reports compressed in 7911ms, zip size=39 MB
INFO: Analysis report uploaded in 6604ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/SonarJunit

【问题讨论】:

    标签: xml junit sonarqube sonar-runner sonar-plugin


    【解决方案1】:

    如果您可以将数据转换为 JUnit 格式,那么您应该能够将这些数据提取到 SonarQube。查看the docs 了解要设置的属性。

    要查看此数据,您将使用Measures page。

    【讨论】:

    • 感谢您的回复,我不明白我们如何能够准确地使用它?我们只有一个 xml 报告,我们将把它转换成一个 Junit-Format 报告。文档中的用法说我们需要surefire-reports。
    • ...我觉得是一样的...?
    • 谢谢 Ann,我们使用 Jenkins 和 Sonar 插件执行了这个,带有 Sonar 属性:sonar.junit.reportsPath = */reports/.xml,(也尝试了路径 */reports/),我们得到下一条评论中提到的控制台输出。但是在 measure 选项卡中的 sonarQube 输出,我们看不到任何与 Junit 结果相关的内容。请帮忙。
    • 我已将 jenkins 控制台输出添加到问题中,因为无法在评论中将其复制到此处。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-23
    • 2019-07-07
    • 2018-01-06
    • 2022-11-16
    • 2018-09-07
    • 1970-01-01
    相关资源
    最近更新 更多