摩卡·詹金斯记者和SonarQube

时间:2020-01-09 13:26:08

标签: sonarqube mocha

我尝试将mocha-jenkins-reporter的结果集成到SonarQube。构建脚本运行以下命令:

set "JUNIT_REPORT_PATH=report.xml"
set "JENKINS_REPORTER_ENABLE_SONAR=true"
set "JENKINS_REPORTER_TEST_DIR=tests"
call npm run test-jenkins

命令完成后,我会看到一个新文件report.xml。但是从这一点上,我不知道如何将其集成到SonarQube中。 mocha-jenkins-reporter的描述在这里不是很有帮助(摘自https://www.npmjs.com/package/mocha-jenkins-reporter):

SonarQube is a popular tool for continuous inspection of code quality. You can find 
documentation for JavaScript language on JavaScript Plugin page.

One aspect of SonarQube analysis is outcome of unit tests. To properly display test results 
environment variable JENKINS_REPORTER_ENABLE_SONAR must be set to true. By default reporter 
looks for tests in ./test directory. It can be changed using environment variable 
JENKINS_REPORTER_TEST_DIR and providing relative path to the directory with tests.

我认为我必须更改sonar-project.properties,但是我找不到任何有用的信息。

0 个答案:

没有答案