I am trying to setup code coverage on Azure Piplelines.
I enabled it in the YAML file and can see that the .coverage file is created but it doesn't show the details in the CodeCoverage tab in Azure DevOps.
I believe it needs an html file to be generated. My project is in C#.
My yaml file has the following test tasks.
- task: VSBuild@1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
codeCoverageEnabled: true
runSettingsFile: 'src/ProjectName.runsettings'
Here is the result:

Can someone provide some guidance?
CodeCoverage results not showing in Azure DevOps even though .coverage file is created
This is a known issue on Azure devops. Now, we could only download the report.
Azure devops only support the download link for .coverage files currently. The white page you see is a UI glitch. This scenario is only supposed to render a download link to the coverage file.
Besides, it has been submitted in this earlier suggestion ticket linked here:
support vstest .coverage "code coverage" build results tab
This feature request is On Roadmap, I believe it will be released soon, you can follow this thread to know its latest feedback.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With