我正在使用 azure devops 来运行测试并尝试将 sonarqube 与其集成。我面临的问题是,在 azure pipeline 的摘要部分中,我能够将代码覆盖率视为 22%,但在 sonarqube 控制台中我只能将代码覆盖率视为“-”。当我在管道中运行“运行代码分析”任务时,我看到一条警告消息。警告消息为 WARN: 代码覆盖率报告不包含所包含文件的任何覆盖率数据。[请找图查看azure pipeline中显示的代码覆盖率][1]
这是点测试任务的 yaml
- task: DotNetCoreCLI@2
displayName: 'dotnet test'
inputs:
command: test
projects: '**/*Test*.csproj'
arguments: '--configuration $(BuildConfiguration) --collect "Code coverage" '
workingDirectory: '$(System.DefaultWorkingDirectory)'
This is the yaml for copy files task that i am doing right after the dot test task
steps:
- task: CopyFiles@2
displayName: 'Copy Files to: $(Common.TestResultsDirectory)'
inputs:
SourceFolder: '$(Agent.WorkFolder)\_temp'
TargetFolder: '$(Common.TestResultsDirectory)'
Please find the yaml file for Prepare analysis on sonarqube task
displayName: 'Prepare analysis on SonarQube'
inputs:
SonarQube: 'CDA-Sonarqube'
projectKey: Test
projectName: Test
extraProperties: sonar.cs.nunit.reportsPaths
Any help is appreciated.
[1]: https://i.stack.imgur.com/HbZfW.png
心有法竹
潇潇雨雨
相关分类