【问题标题】:SonarQube not publishing the PHP unit test reportSonarQube 未发布 PHP 单元测试报告
【发布时间】:2018-11-07 12:53:13
【问题描述】:

我在 Redhat 6 Serer 中安装低于 SonarQube 版本。 版本: 声纳:6.3 声纳亚军:2.3 声纳 PHP 插件:2.10.0.2087

我的项目在名为“testreports”的目录中创建了一个 PHPUnit 测试报告

sonar.project.properties:

# Required metadata
sonar.projectKey=Dashboard3
sonar.projectName=Dashboard3
sonar.projectVersion=2.0
#sonar.language=php

#Path to Source
sonar.sources=/pkg/vddfg/oradfg/apache/htdocs/Symfony/src/DB3
sonar.sourceEncoding=UTF-8
sonar.php.tests.reportPath=testReports/get_jfm_bug11s_test.xml

sonar.exclusions=**/Metro-UI-CSS-master/**

我的 Sonar 成功执行,将行更新为 Analyzing PHPUnit test report: testReports/get_jfm_bug11s_test.xml 但在 SonarQube 仪表板中我们无法找到测试报告。

如何解决这个问题?

【问题讨论】:

    标签: sonarqube sonar-runner phpunit


    【解决方案1】:

    1) 使用 JUnit 输出格式进行测试(PHPUnit 配置):

    <log type="junit" target="tests.xml"/>
    

    2) 将“sonar.tests”添加到您的 Sonar 属性中:

    sonar.tests=/path/to/tests
    

    【讨论】:

      猜你喜欢
      • 2018-09-07
      • 2018-11-08
      • 2021-01-29
      • 2016-10-31
      • 2017-11-18
      • 2019-07-07
      • 2014-02-15
      • 2016-10-27
      • 2016-01-13
      相关资源
      最近更新 更多