Skip to content

test(change-risk): pin that a filtered call shares the early test selection - #5053

Merged
swati510 merged 1 commit into
mainfrom
fix/change-risk-headstart-filters
Oct 30, 2026
Merged

swati510 merged 1 commit into
mainfrom
fix/change-risk-headstart-filters

Conversation

@RaghavChamadiya

Copy link
Copy Markdown
Member

get_change_risk starts the test selection beside the score for a named commit or range, and the tests block joins it. The tests block reads the whole commit (only repowise's own output is left out), so the request's exclude_patterns, extensions and include_paths narrow the score but not the tests' change, and a filtered call shares the early selection.

No test pinned that for filtered calls. The existing head-start test now runs once per filter, with a commit the filter narrows, and must still select tests from a single selection run. If either side of the change ever started honoring the filters alone, the two changes would differ and the test would see two runs.

Cold filtered calls on current main, one process each (impacted_tests present, selection runs):

Repo Revspec Filters ms impacted_tests Selections
repowise HEAD none 16775 degraded, 10 shown 1
repowise HEAD exclude docs/ 9662 degraded, 10 shown 1
repowise HEAD extensions .py 10451 degraded, 10 shown 1
repowise HEAD include packages/ 10767 degraded, 10 shown 1
hono HEAD none 1303 run_all 1
hono HEAD exclude *.test.ts 1609 run_all 1
hono HEAD extensions .ts 2005 run_all 1
hono HEAD include src/middleware/ 1603 run_all 1

No call returned busy or timeout. ("degraded" is an index that lags the checkout; "run_all" on hono comes from its config.)

Verification: tests/unit/server/mcp/test_change_test_selection.py, tests/unit/change_health/test_mcp_contract.py (44 passed), top-level tests/unit/*.py (1901 passed), ruff check ., repowise health check origin/main...HEAD passed.

…ection

The test selection that starts beside the score reads the whole commit, as the
tests block does: the request's exclude_patterns, extensions and include_paths
narrow the score, not the tests' change. Each filter now runs through the
existing head-start test with a commit the filter narrows, and the call must
still select tests from one run.
@swati510
swati510 merged commit bbadebb into main Oct 30, 2026
14 checks passed
@swati510
swati510 deleted the fix/change-risk-headstart-filters branch October 30, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants