If a GitHub Code Quality coverage upload has started failing with a Cobertura XML error, inspect the report your test job produced. GitHub now validates the file’s format during upload. A workflow that previously appeared to succeed while showing no pull request coverage can therefore expose the problem directly in its Actions log.

The November 23 announcement applies to the upload-code-coverage action. GitHub says the change is available on Team and Enterprise Cloud, including data residency, and requires Code Quality to be enabled. Start with the failing step and trace its input before changing your tests.
Confirm which file reached the upload step
Copy the file path from the uploader configuration and compare it with the output location reported by the test command. In a project with several test jobs, it is easy to generate the intended XML file in one directory while uploading an older report from another. Record the job, test command and output path together so a teammate can follow the same trail.
Inspect the file’s contents as well as its name. Renaming a report to end in .xml leaves its underlying format unchanged. If your tool generated LCOV, choose its supported Cobertura output option or a conversion step appropriate to that tool. Keep the original test failure information visible while you make the reporting change.
Generate and upload the same report
GitHub’s coverage setup guide includes examples for producing Cobertura XML and configuring the upload action. For a Python project already using pytest-cov, its example generates XML with the following command.
pytest --cov=. --cov-report=xml
Adapt the measured paths to your project and point the upload step at the resulting report. Review any pre-existing filters so generated code, tests or omitted packages receive the treatment your team intended. Changing the report format should leave you able to explain which source files were measured.
Check the default branch and pull request evidence
The setup guide describes coverage on the default branch as the baseline for pull request comparison. After correcting the format, inspect the relevant workflow configuration for both kinds of run. Verify that a fresh report is produced before its upload step, then check the pull request’s coverage summary and a changed file you understand.
For example, use an ordinary change to a small function and inspect whether its file appears in the report and the resulting comparison. A successful upload is one part of the check. The displayed result also needs to describe the intended code revision and measured files. Our pull request review guide covers following checks back to their evidence.
Leave a clear troubleshooting note
Record the producer command, file path and report format beside your workflow instructions. If another developer sees the same failure, they can compare those three details before rerunning a long suite. Include how your team verified the first corrected upload, such as the workflow run and pull request used. That gives future maintainers a concrete example to inspect.
Prepared with AI assistance from GitHub’s announcement and setup documentation. Examples are illustrative. TechPulse did not execute this workflow in a repository. See our editorial policy.
✍️ Leave a Comment