Upload test coverage to GitHub Code Quality - #920
Draft
Sun Haoran (haoranpb) wants to merge 2 commits into
Draft
Sun Haoran (haoranpb) wants to merge 2 commits into
Sun Haoran (haoranpb) wants to merge 2 commits into
Conversation
Code Quality is enabled for the repository, so CI uploads the pytest coverage report and github-code-quality[bot] comments on pull requests. - Coverage paths are repo-relative (relative_files + include), so files with the same name in bcbench and bcbench_core map unambiguously - CI checks out the PR head instead of the merge commit, as the upload requires, and only the Ubuntu run uploads to keep one report per label Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3fa47b3c-f5d6-4c36-9be3-c4fdf2bebe47
The coverage API rejects uploads from non-default branches without a pull request number, so manually dispatched runs on feature branches skip it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3fa47b3c-f5d6-4c36-9be3-c4fdf2bebe47
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack 4, stacked on #918. Code Quality is enabled for the repository; this uploads the pytest coverage report so
github-code-quality[bot]reports PR coverage againstmain(manual setup docs).uv run pytest --cov --cov-report=term-missing --cov-report=xmlwrites a Coberturacoverage.xml(already gitignored).--covsource folders, coverage records paths relative to each folder, sologger.pyor__init__.pycannot be mapped back unambiguously.[tool.coverage.run]now usesrelative_files = truewith anincludeallow-list, so every entry is a repo path such assrc/bcbench/logger.py. Trade-off: only imported modules are reported; in the full suite that excludessrc/bcbench/__main__.pyalone.actions/upload-code-coverage(pinned to v1.4.4) runs on the Ubuntu matrix leg only, keeping one report per label, and skips fork PRs, which cannot getcode-quality: write. The job gainscode-quality: write.lint-and-testchecks out the PR head instead of the merge commit, as the docs require for line mapping. Both lint and tests now run on the PR head; the other jobs are unchanged.The baseline appears after the first push to
main; coverage comments appear on PRs that targetmain.