【发布时间】:2021-06-04 09:31:53
【问题描述】:
我使用 Azure 管道运行单元测试和 SonarQube 集成。当我使用 cobertura 进行单元测试时,我无法将代码覆盖率结果传递到 SonarQube,尽管我在管道日志中看到了结果。但是,当我使用 OpenCover 时,这同样适用。
我在管道日志中也看到了这个警告,尽管我不确定这是否相关:“Missing blame information for the following files”
管道目前如下所示
- task: DotNetCoreCLI@2
inputs:
command: ‘test’
projects: |
<test-proj>
arguments: ‘/p:CollectCoverage=true /p:CoverletOutputFormat=cobertura’
displayName: ‘Run Tests’
- task: SonarQubePrepare@4
inputs:
SonarQube: <Service-Endpoint>
scannerMode: ‘MSBuild’
projectKey: ‘test:service’
projectName: ‘test:service’
extraproperties: |
sonar.flex.cobertura.reportPaths=$(Build.SourcesDirectory)/**/coverage.cobertura.xml
- task: DotNetCoreCLI@2
<Running DotNet build>
- task: SonarAnalyze@4
在运行 DotNet 测试阶段时,测试结果是在这个路径中获得的 - E:\agent-5\2\s\test\ApiTest\coverage.cobertura.xml
任何建议将不胜感激。
【问题讨论】:
-
您的问题进展如何?下面的回复有用吗?
标签: azure azure-devops sonarqube azure-pipelines sonarscanner