无法将Javascript测试结果导入sonar qube

unable to import Javascript test results to sonar qube

本文关键字:导入 sonar qube 测试结果 Javascript      更新时间:2023-09-26

我使用了这个属性,报告是XML格式的,javascript单元结果不能导入声纳仪表板。

project.home=..''..''PeriodDataFrontEnd
bevo-web-module.sonar.javascript.jstestdriver.reportsPath=.
bevo-web-module.sonar.projectBaseDir=.''bevo-web''src`
Sensor JavaScriptSquidSensor done: 493293 ms
10:45:51.310 INFO  - Sensor JsTestDriverSensor...
10:45:51.311 INFO  - Parsing Unit Test run results in Surefire format from folder D:'workspace'PeriodDataFrontEnd'bevo-web'src'.
10:45:51.455 WARN  - Test result will not be saved for test class "0.2403 (Windows 7 0.0.0).Given the container controller", because SonarQube associated resource has not been found using file name: "0'2403 (Windows 7 0'0'0)'Given the container controller.js"
10:45:51.576 WARN  - Test result will not be saved for test class "0.2403 (Windows 7 0.0.0).Given the container nav controller", because SonarQube associated resource has not been found using file name: "0'2403 (Windows 7 0'0'0)'Given the container nav controller.js"
10:45:51.688 WARN  - Test result will not be saved for test class "0.2403 (Windows 7 0.0.0).Given the browser has received JSON from the server when converting the JSON to a Page instance", because SonarQube associated resource has not been found using file name: "0'2403 (Windows 7 0'0'0)'Given the browser has received JSON from the server when converting the JSON to a Page instance.js"
10:45:51.805 WARN  - Test result will not be saved for test class "0.2403 (Windows 7 0.0.0).Given the page controller", because SonarQube associated resource has not been found using file name: "0'2403 (Windows 7 0'0'0)'Given the page controller.js"

在这里输入代码

从日志中给出的信息我们可以推断出您提供的XML报告不遵循JavaScript插件支持的格式:Test result will not be saved for test class "0.2403 (Windows 7 0.0.0).Given the container controller", because SonarQube associated resource has not been found using file name: "0'2403 (Windows 7 0'0'0)'Given the container controller.js"

一些解释:

  • 为了将测试执行信息关联到测试文件,JavaScript插件需要有一个测试文件的路径。插件从xml测试报告中检索这些信息,并且它只支持js-test-driver xml格式。
  • 从你提供的日志中,我们可以清楚地看到,在插件期望文件路径的地方,它发现了一些不能用来检索测试文件的东西。

要了解更多细节,请参阅本文档页面,希望它足够清楚:http://docs.sonarqube.org/display/SONAR/Unit+Test+results+import