The duplicated artifacts observed when using PublishCodeCoverageResults@2 in your pipeline with pytest and pytest-cov are due to how the task internally generates unique coverage summary reports. The suffix strings after "Summary_" are unique identifiers (usually hashes) representing different report versions or metadata generated during the pipeline execution.
- The duplicated artifacts like Summary_4ecf013f: coverage.xml and Summary_ffd3a4e0: coverage.xml result because PublishCodeCoverageResults@2 internally processes multiple coverage report snapshots or segments, assigning unique identifiers.
- There is currently no option in the PublishCodeCoverageResults@2 task to disable this duplication or the internal report generation mechanism.
- This behavior is known and documented in community reports and GitHub issues, and Microsoft is aware but has not provided a built-in configuration to suppress duplication yet.
- Until a future update, you can either accept these duplicates or revert to using PublishCodeCoverageResults@1 combined with a separate report generation step for more control.
- Ensure your pytest.ini or coverage config files are not generating multiple coverage files inadvertently.
- Monitor Microsoft Docs and GitHub for updates or fixes to this behavior.
References:
PublishCodeCoverageResults@2 - Publish code coverage results v2 task | Microsoft Learn
I hope the provided answer is helpful,
Please "Up Vote" if the information helped you. This will help us and others in the community as well.
Thank you.