Repository navigation
fix(coverage): resolve per-test coverage records with the same path resolver as the aggregate - #4328
Merged
Merged
Conversation
RaghavChamadiya
force-pushed
the
fix/coverage-per-test-resolve
branch
from
October 21, 2026 04:36
d1f13d4 to
b727c23
Compare
RaghavChamadiya
force-pushed
the
fix/coverage-reingest-newer-reports
branch
2 times, most recently
from
October 21, 2026 05:31
b938593 to
59d0c7c
Compare
RaghavChamadiya
force-pushed
the
fix/coverage-per-test-resolve
branch
from
October 21, 2026 05:31
b727c23 to
9c91913
Compare
…esolver as the aggregate Per-test records matched report paths on their own, without the report's directory, so in a monorepo a package's per-test lcov (or a .coverage with relative paths) tied between packages and was dropped while the aggregate read of the same report mapped every file. resolve_test_reports now resolves the source path and the test's own file through _resolve_path, the aggregate resolver, which takes the report's directory and roots as arguments. coverage add records each context report's directory (report_origin_dir) so per-test and per-file coverage map alike.
RaghavChamadiya
force-pushed
the
fix/coverage-per-test-resolve
branch
from
October 21, 2026 08:56
9c91913 to
c3b12e7
Compare
swati510
approved these changes
Oct 21, 2026
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.
Per-test records matched report paths on their own, without the report's directory. In a monorepo, a package's per-test lcov (or a
.coveragewith relative paths) tied between packages and was dropped, while the aggregate read of the same report mapped every file.resolve_test_reportsnow resolves both the source path and the test's own file through_resolve_path, the aggregate resolver. That resolver takes the report's directory and roots as arguments.coverage addrecords each context report's directory, so per-test and per-file coverage map alike.Stacked on #4327.
Verification
coverage addtest stores both the per-file rows and the per-test map under the package.pytest tests/unit -k "coverage or test_map or impacted or test_impact or selection": 1,471 passed.ruff checkclean.