Publish Coverage Results in Azure DevOps
- Dominant language
- TSQL
- Stars
- 69
- Forks
- 55
- PR merge metrics
- No merged PRs in 30d
Description
**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

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 :)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the captured ReportGenerator output, the Cobertura XML path, and the Azure DevOps Publish Coverage Results task's Path to Source files setting. Compare the source paths in the generated report with the paths available to Azure DevOps; done means the published result shows source files and code as well as coverage metrics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, sql
- Domain
- ci-cd, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100