Code Coverage Tab doesn't appear even with published Cobertura files.
See original GitHub issueRequired Information
Question, Bug, or Feature?
Type: Bug
Enter Task Name: Publish Code Coverage Result
https://github.com/microsoft/azure-pipelines-tasks/tree/master/Tasks/PublishCodeCoverageResultsV1
Environment
-
Server - Azure Pipelines or TFS on-premises?
- Azure Pipelines - Cannot provide any info about that, private project.
-
Agent - Hosted or Private:
- Agent - Hosted - OS: Windows (Latest) - Version: 2.164.6
Issue Description
After the publish of the code coverage results, it doesn’t appear in a tab as some other do, it appears at the artifacts built for that run, but it does not appear in the Code Coverage tab.
Example (from ReportGenerator project, that I use in the pipeline as a Task too):
Mine:
My code coverage is actually EMPTY, it doesn’t have any line covered, but as it created the .html file, it should show at the tab, correct?.
Imagem from the generated code coverage result:
Task logs
2020-01-29T23:02:58.8490697Z ##[section]Starting: Publish code coverage
2020-01-29T23:02:58.8578521Z ==============================================================================
2020-01-29T23:02:58.8578565Z Task : Publish code coverage results
2020-01-29T23:02:58.8578590Z Description : Publish Cobertura or JaCoCo code coverage results from a build
2020-01-29T23:02:58.8578632Z Version : 1.160.1
2020-01-29T23:02:58.8578656Z Author : Microsoft Corporation
2020-01-29T23:02:58.8578680Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/test/publish-code-coverage-results
2020-01-29T23:02:58.8578735Z ==============================================================================
2020-01-29T23:02:59.2856105Z [command]"C:\Program Files\dotnet\dotnet.exe" d:\a\_tasks\PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97\1.160.1\netcoreapp2.0\ReportGenerator.dll -reports:d:\a\1\s\src\MMM.Tests\TestResults\Cobertura.xml -targetdir:d:\a\_temp\cchtml -reporttypes:HtmlInline_AzurePipelines
2020-01-29T23:02:59.3408000Z 2020-01-29T23:02:59: Arguments
2020-01-29T23:02:59.3408403Z 2020-01-29T23:02:59: -reports:d:\a\1\s\src\MMM.Tests\TestResults\Cobertura.xml
2020-01-29T23:02:59.3408627Z 2020-01-29T23:02:59: -targetdir:d:\a\_temp\cchtml
2020-01-29T23:02:59.3408904Z 2020-01-29T23:02:59: -reporttypes:HtmlInline_AzurePipelines
2020-01-29T23:02:59.4605080Z 2020-01-29T23:02:59: Executable: d:\a\_tasks\PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97\1.160.1\netcoreapp2.0\ReportGenerator.Core.dll
2020-01-29T23:02:59.4608640Z 2020-01-29T23:02:59: Working directory: d:\a\1\s
2020-01-29T23:02:59.4902746Z 2020-01-29T23:02:59: Loading report 'd:\a\1\s\src\MMM.Tests\TestResults\Cobertura.xml' 1/1 in memory
2020-01-29T23:02:59.5494871Z 2020-01-29T23:02:59: Finished parsing d:\a\1\s\src\MMM.Tests\TestResults\Cobertura.xml...
2020-01-29T23:02:59.5495311Z 2020-01-29T23:02:59: Parsing of 1 files completed.
2020-01-29T23:02:59.5497152Z 2020-01-29T23:02:59: Start merge result 1
2020-01-29T23:02:59.5515341Z 2020-01-29T23:02:59: Finished merge result 1
2020-01-29T23:02:59.5637398Z 2020-01-29T23:02:59: Initializing report builders for report types: HtmlInline_AzurePipelines
2020-01-29T23:02:59.5674338Z 2020-01-29T23:02:59: Analyzing 0 classes
2020-01-29T23:02:59.5758631Z 2020-01-29T23:02:59: Writing report file 'd:\a\_temp\cchtml\index.htm'
2020-01-29T23:02:59.6181517Z 2020-01-29T23:02:59: Report generation took 0.1 seconds
2020-01-29T23:02:59.6271620Z Generated code coverage html report: d:\a\_temp\cchtml
2020-01-29T23:02:59.6333819Z Reading code coverage summary from 'd:\a\1\s\src\MMM.Tests\TestResults\Cobertura.xml'
2020-01-29T23:02:59.7336848Z ##[section]Async Command Start: Publish code coverage
2020-01-29T23:02:59.7336912Z Publishing coverage summary data to TFS server.
2020-01-29T23:02:59.7336939Z Lines- 0 of 0 covered.
2020-01-29T23:02:59.7336964Z Branches- 0 of 0 covered.
2020-01-29T23:03:00.2426548Z Modifying Cobertura Index file
2020-01-29T23:03:00.2426714Z Publishing code coverage files to TFS server.
2020-01-29T23:03:00.2426782Z Uploading 3 files
2020-01-29T23:03:05.3146514Z Total file: 3 ---- Processed file: 2 (66%)
2020-01-29T23:03:05.9064653Z File upload succeed.
2020-01-29T23:03:05.9064735Z Published 'd:\a\_temp\cchtml' as artifact 'Code Coverage Report_37'
2020-01-29T23:03:05.9064786Z ##[section]Async Command End: Publish code coverage
2020-01-29T23:03:05.9065274Z ##[section]Finishing: Publish code coverage
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Code coverage tab not showing in Azure DevOps
I have a number of pipelines with multiple stages and the Code Coverage tab only appears after all the stages have been completed...
Read more >Code Coverage tab not displaying report when using runsettings
The issue is that when applying a runsettings file against the test task, the generated report does not display and only produces an...
Read more >Publish code coverage results v1 task - Microsoft Learn
The publish code coverage results task generates and publishes the HTML report, which is a set of HTML files that are linked from...
Read more >how to view Code Coverage report on Azure DevOps - Code4IT
Publish code coverage results. Now that we have the coverage.cobertura.xml file, the last thing to do is to publish it. Create a task...
Read more >The Easiest Way to Generate and Publish .NET Code ...
This doesn't really solve the problem where Azure DevOps will not show the Code Coverage tab until the entire pipeline (including all ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@FernandoKGA this is currently lower priority compared to other items we have. We will not be picking this up as we are working on revamping the coverage experience and that view would eventually replace this. Thank you for reporting this though.
Thanks! @FernandoKGA for trying out the scenario and sharing the results with us.
This looks like an issue on our side we will investigate and get it fixed.