我正在使用Sonarqube检查我的代码(Typescript),我想提供我项目的覆盖率部分,但在分析步骤中,Sonarqube总是忽略我的测试文件。
记录OUTOUT
[14:19:40][Step 2/7] 15:19:40.702 INFO - Sensor SonarTS [typescript] (done) | time=18007ms
[14:19:40][Step 2/7] 15:19:40.702 INFO - Sensor Generic Test Executions Report
[14:19:40][Step 2/7] 15:19:40.703 INFO - Parsing /opt/BuildAgent/work/75c8514d66f0312a/coverage/sonar.xml
[14:19:40][Step 2/7] 15:19:40.720 INFO - Imported test execution data for 0 files
[14:19:40][Step 2/7] 15:19:40.720 INFO - Test execution data ignored for 19 unknown files, including:
[14:19:40][Step 2/7] tests/modules/account/datamodel.spec.ts
[14:19:40][Step 2/7] tests/modules/account/graphql.spec.ts
[14:19:40][Step 2/7] tests/modules/cron/datamodel.spec.ts
[14:19:40][Step 2/7] tests/modules/cron/graphql.spec.ts
[14:19:40][Step 2/7] tests/modules/dynamic-field/datamodel.spec.ts
[14:19:40][Step 2/7] 15:19:40.720 INFO - Sensor Generic Test Executions Report (done) | time=18ms
[14:19:40][Step 2/7] 15:19:40.722 INFO - ------------- Run sensors on project
[14:19:40][Step 2/7] 15:19:40.728 INFO - Sensor Zero Coverage Sensor
[14:19:40][Step 2/7] 15:19:40.773 INFO - Sensor Zero Coverage Sensor (done) | time=45ms我已经检查过了,所有这些“未知文件”都存在。我做错了什么?
发布于 2019-05-13 22:59:19
解决方案。
在我的TeamCity附加参数中,我添加了:
-Dsonar.testExecutionReportPaths=coverage/sonar.xml
-Dsonar.test.inclusions=tests/modules/**/*.spec.ts
-Dsonar.tests=.https://stackoverflow.com/questions/56114501
复制相似问题