Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Exclude external directory when generating python report #2136

Merged
merged 3 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ A brief description of the categories of changes:

### Fixed
* (gazelle): Fix incorrect use of `t.Fatal`/`t.Fatalf` in tests.
* (toolchain) Omit third-party python packages from coverage reports from
stage2 bootstrap template.

### Added
* Nothing yet
Expand Down
8 changes: 8 additions & 0 deletions python/private/stage2_bootstrap_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,14 @@ def _maybe_collect_coverage(enable):
# Pipes can't be read back later, which can cause coverage to
# throw an error when trying to get its source code.
"/dev/fd/*",
# The mechanism for finding third-party packages in coverage-py
# only works for installed packages, not for runfiles. e.g:
#'$HOME/.local/lib/python3.10/site-packages',
# '/usr/lib/python',
# '/usr/lib/python3.10/site-packages',
# '/usr/local/lib/python3.10/dist-packages'
# see https://github.com/nedbat/coveragepy/blob/bfb0c708fdd8182b2a9f0fc403596693ef65e475/coverage/inorout.py#L153-L164
"*/external/*",
aignas marked this conversation as resolved.
Show resolved Hide resolved
],
)
cov.start()
Expand Down