Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CodeCoverage results not showing in Azure DevOps even though .coverage file is created

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: Azure Devops screenshot

Can someone provide some guidance?

like image 551
Renuka Mulay Avatar asked Nov 22 '25 15:11

Renuka Mulay


1 Answers

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.

like image 138
Leo Liu-MSFT Avatar answered Nov 24 '25 07:11

Leo Liu-MSFT



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!