Publish Code Coverage Results task need access to source
See original GitHub issueSee
Type: Unknown (see below) Task Name: PublishCodeCoverageResults@1
Environment
- Server - Azure Pipelines
- Agent - Hosted
Issue Description
We build our code, run tests and generate coverage with coverlet, in a Docker container. So Cobertura files are generated inside Docker container, then taken out, and finally content is passed to PublishCodeCoverageResults@1. This means that at the time Cobertura coverage xml file is used by PublishCodeCoverageResults@1 task, source code location has changed. See the warnings in task screenshot “File XXX does not exist (any more).” In the Docker container it was /app/src/ while outside it is app/src. The task doesn’t seem to be able to relink to these paths even though we provide ‘pathToSources’. See task configuration:
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: 'app/testout/Cobertura.xml'
reportDirectory: 'app/testout/'
failIfCoverageEmpty: true
pathToSources: 'app/src'
This means code coverage will get uploaded to ADO but we cannot browse files, which is really not the best. See:
Is there anything we can do? Right now it’s really not the best.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top GitHub Comments
@molinch we have made the fix. It should be available in 2-3 days once it is deployed.
Thanks @anshii03 it works as a charm now