Forum Discussion
douglasdb1
Sep 29, 2023Copper Contributor
Sometimes Pull Request don't get the Azure Pipeline coverage result
We have a coverage job in a Node JS with Jest project configured in or pipeline: And the job run and passed successfully: But the PR still with awaiting:...
Kidd_Ip
Jul 28, 2025MVP
Please try to fix by the following:
1. Ensure Jest outputs Cobertura format: In jest.config.js:
coverageReporters: ['text', 'clover', 'cobertura']
This generates cobertura-coverage.xml which Azure understands.
2. Update your pipeline YAML:
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage/cobertura-coverage.xml'
condition: succeededOrFailed()
3. Add a delay or dependency between test and publish steps to ensure coverage files are ready.
4. Use PublishTestResults@2 for test output (e.g. junit.xml) to improve PR feedback:
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/junit.xml'
condition: succeededOrFailed()
5. Double-check PR triggers: Make sure your pipeline is configured to run on PRs and that the coverage task is part of that trigger.