Repository navigation
Leave untested changed sources out of Quick Feedback coverage - #9778
Merged
Merged
Conversation
When a change maps to too many test targets, limit_test_paths narrows the run to the directly changed tests. run_tests still passed every changed .py file to coverage --include, so the uploaded report counted lines in those files that the narrowed tests never exercise. On the reference-only PRs #9764 and #9766 that sent codecov/project to 54% and 69% while codecov/patch was 100%. A narrowed run now skips coverage, like the existing path for changes with no Python source. Codecov then gets no partial report and posts no project status, matching PRs that Quick Feedback defers entirely. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Narrowing is one of two ways Quick Feedback drops a changed file's tests; deferring slow directories (gov/ssa, household, reform, ...) is the other, and it produced the same partial report. Replace the narrowed-scope flag with a per-file rule: a changed source is measured unless it maps to tests and none of them are in this run. Files with no mapped tests keep today's behaviour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 4, 2026
Contributor
Author
|
Merged by the US + core hub on its merge gates. Audit:
|
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.
Summary
Quick Feedback measures coverage only for changed source files whose tests actually run in that job. A changed
.pyfile is left out of coverage when it maps to test targets and none of them are in the run, because the job deferred them or narrowed them away. Files with no mapped tests are measured as before.Why
limit_test_pathsdrops a changed file's tests in two ways:SELECTIVE_TEST_MAX_TARGETStargets orSELECTIVE_TEST_MAX_FILEStest files, it runs only the directly changed tests.gov/ssa,household,reform,microsimulation,contrib/congress) to the full suite.run_testsstill passed every changed non-test.pyfile tocoverage run --include. The report then counted those files' formula bodies as uncovered, and Codecov scored the PR's project coverage from that report alone.Observed:
gov/hud/integration.yaml. Coverage over its 26 changed variable files was 69%, so codecov/project failed (-30.91%) while codecov/patch was 100%. Log: run 37144819774, job 111267711769.Change
SelectiveTestRunner.get_untested_sources(source_files, test_paths)returns the source files whosemap_files_to_tests({file})is non-empty and shares no target with the run.run_testsdrops those files from--includeand lists them. When none are left, it runs without coverage, socoverage xmlwrites nothing,has_coverage=falseskips the Codecov upload, and Codecov posts no project status. That is already what happens today for changes with no Python source and for runs deferred entirely.The whole selector is unchanged when no targets are dropped.
Replaying the real changed-file lists through the new code, with the CI limits of 25 targets and 100 files:
.pysourcesInvariant
A changed source is in the coverage
--includelist exactly when one of these holds:Four tests in
policyengine_us/tests/core/test_run_selective_tests.py:gov/ssasource drops out while thegov/irssource whose tests run stays in;get_untested_sources.On
upstream/main's selector, the first, second and fourth fail on their assertions and the third passes. Locally the file has 18 passed.Microsimulation impact
None. The PR changes only CI test selection (
policyengine_us/tests/run_selective_tests.pyand its tests). No variable, parameter or dataset changes, so no model output can change. Its effect is on which changed files the Quick Feedback job counts for coverage.axiom: n/a: CI test-selection infrastructure
🤖 Generated with Claude Code