【问题标题】:How to configure test file xml in sonarqube?如何在 sonarqube 中配置测试文件 xml?
【发布时间】:2018-10-17 11:24:39
【问题描述】:

我在 JS 项目中使用 sonarqube,我想为单元测试集成 XML 结果。我有这个错误:

ERROR: Caused by: Line 2 of report refers to a file which is not configured as a test file: modules/project/projectTest.js

我不明白为什么会出现此错误。 projectTest 文件被分析,我是否需要设置一些东西以便 sonarqube 可以将它们作为测试文件处理。

我的 XML 结果文件:

<testExecutions version="1">
 <file path="modules/proejct/projectTest.js">
  <testCase name="Test" duration="16"/>
 </file>
</testExecutions>

感谢您的帮助

【问题讨论】:

    标签: javascript sonarqube


    【解决方案1】:

    单元测试报告中引用的文件必须是测试文件,换句话说,它们应该由 sonar.tests 属性配置。请参阅文档https://docs.sonarqube.org/display/SONAR/Analysis+Parameters

    【讨论】:

      猜你喜欢
      • 2016-12-31
      • 2016-09-14
      • 2011-02-13
      • 1970-01-01
      • 2019-05-24
      • 2019-12-19
      • 2019-09-30
      • 1970-01-01
      • 2011-05-04
      相关资源
      最近更新 更多