Skip to content

Publish Coverage Results in Azure DevOps #70

@asos-eugeneniemand

Description

@asos-eugeneniemand

Describe the bug
When using the Cobertura format and using the Publish Coverage Results task in ADO I get the following results in the logs

"C:\Program Files\dotnet\dotnet.exe" C:\Agent\_work\_tasks\PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97\1.186.0\netcoreapp2.0\ReportGenerator.dll -reports:C:\Agent\_work\101\a/**/code-coverage-report*.xml -targetdir:C:\Agent\_work\_temp\cchtml -reporttypes:HtmlInline_AzurePipelines
2021-05-20T14:44:42: Arguments
2021-05-20T14:44:42:  -reports:C:\Agent\_work\101\a/**/code-coverage-report*.xml
2021-05-20T14:44:42:  -targetdir:C:\Agent\_work\_temp\cchtml
2021-05-20T14:44:42:  -reporttypes:HtmlInline_AzurePipelines
2021-05-20T14:44:43: File '' does not exist (any more).
... (1120 more lines)
2021-05-20T14:44:44: File '' does not exist (any more).
2021-05-20T14:44:46: Writing report file 'C:\Agent\_work\_temp\cchtml\index.html'
2021-05-20T14:44:46: Report generation took 3.5 seconds
Generated code coverage html report: C:\Agent\_work\_temp\cchtml
Reading code coverage summary from 'C:\Agent\_work\101\a\_core-edw-combined-ci\core-edw-dwh-tests\DiFramework.UnitTests\code-coverage-report-datawarehouse-2021-05-20T14.44.30.xml'
Async Command Start: Publish code coverage
Publishing coverage summary data to TFS server.

When looking at the published result in ADO it has the metrics but not the file or code, see screenshot below
image

I've noticed there is a field on the taks called Path to Source files with the following tooltip

Path to source files is required when coverage XML reports do not contain absolute path to source files. For e.g., JaCoCo reports do not use absolute paths and when publishing JaCoCo coverage for Java apps, the pattern would be similar to $(System.DefaultWorkingDirectory)/MyApp/src/main/java/.
This input is also needed if tests are run in a docker container. This input should point to absolute path to source files on the host. For e.g., $(System.DefaultWorkingDirectory)/MyApp/

We are not using JaCoCo so I'm not sure if the Cobertura format generated by SQLCover is incorrect or if I need to supply something in the Path to Source files field to make this work correctly

Any ideas are welcome, thanks.

@GoEddie hope you are well mate :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions