[英]SonarQube unit test report doesnt show Javascript files
I have a maven project with modules in both Java and Javascript. 我有一个带有Java和Javascript模块的Maven项目。 I am not seeing the Javascript unit test files in test report in SonarQube but only Java unit test files.
我在SonarQube的测试报告中没有看到Javascript单元测试文件,但是只有Java单元测试文件。 coverage_reports
coverage_reports
In coverage_reports
folder I have cobertura-coverage.xml
created by Jest. 在
coverage_reports
文件夹中,我有Jest创建的cobertura-coverage.xml
。 Is this sonar.javascript.jstest.reportPaths
still used or has it been replaced by some other configuration. 这个
sonar.javascript.jstest.reportPaths
是否仍在使用或已被其他配置替代。 We are using Sonarqube 6.7 at our server. 我们在服务器上使用Sonarqube 6.7。
Edit: For others to know, I used jest-sonar-reporter
and test script as 编辑:为了让其他人知道,我使用了
jest-sonar-reporter
和测试脚本作为
"test": "cross-env CI=true NODE_PATH=./src react-scripts test --env=jsdom --coverage --no-cache -u --testResultsProcessor jest-sonar-reporter"
This created a test report xml file that I used like this 这创建了一个我像这样使用的测试报告xml文件
<sonar.tests>src/test</sonar.tests>
<sonar.testExecutionReportPaths>path/to/test-report.xml</sonar.testExecutionReportPaths>
<sonar.javascript.lcov.reportPaths>path/to/lcov.info</sonar.javascript.lcov.reportPaths>
As far as I can say sonar.javascript.jstest.reportPaths
doesn't exist (and never did). 据我
sonar.javascript.jstest.reportPaths
不存在(也从未存在)。
There are 2 things (from question I'm not sure which one you need): 有两件事(从问题上我不确定您需要哪一件事):
sonar.testExecutionReportPaths
property eventually). sonar.testExecutionReportPaths
属性)。 Finally, to see unit test files for JS, set correctly sonar.tests
property (Java test files are displayed due to smart enough maven scanner) 最后,要查看JS的单元测试文件,请正确设置
sonar.tests
属性(由于足够聪明的maven扫描器,因此显示了Java测试文件)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.