Repository navigation
fix(coverage): find actual tests through spec helper calls - #1128
1 commit merged into
Conversation
code-review-graph reviewOverall risk: 0.55 (MEDIUM) — 18 changed function(s)/class(es), 42 affected flow(s), 2 test gap(s) (0 with no tested caller found, 2 reached only through a caller) Risk-scored changes
Affected execution flows
Reached only through a callerNo test names these directly, but a tested caller reaches them along the call path shown. That is a path in the call graph, not a record of execution -- the caller's tests may never take this branch. Treat it as where to look, not as coverage: these count as gaps and are scored as untested.
Powered by code-review-graph — local-first analysis; no code leaves the CI runner. |
There was a problem hiding this comment.
🟡 Changes recommended
Helper-only test reachability incorrectly lowers coverage risk and can remove untested symbols from review priorities; risk scoring must exclude helper-route results and gain a regression test.
1 open issue
What changed in this PR
This PR addresses #1109 by letting graph queries find actual tests that reach production symbols through test-file helpers, improving React component test-gap reporting.
Changes:
- Adds bounded incoming CALLS traversal from symbols through helpers to Test nodes.
- Integrates helper routes into test lookup and indirect gap classification.
- Adds regressions for shared helpers, ambiguous links, cycles, traversal limits, and a real TSX build.
| File | Description |
|---|---|
tests/test_test_helper_routes.py |
Adds helper-route regressions and React integration coverage. |
code_review_graph/graph.py |
Resolves helper-to-test paths for test queries and caller-route reporting. |
Review effort: Balanced
| for route in self._get_test_helper_routes( | ||
| input_qns, max_depth + 1, max_frontier, self.get_repo_root(), | ||
| ).values(): |
0160eb0
…ymbol (review of tirth8205#1128) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

React spec helpers can create a resolved
Test -> view -> WidgetCALLS path without aWidget -> TestTESTED_BY edge. Bothtests_forand the change report currently lose that evidence because test-file callers are excluded from the caller walk.Follow bounded, resolved incoming CALLS through test helpers until an actual Test declaration is reached. Return the real test identities, retain all tests sharing a helper, and report the path as indirect reachability at the existing full untested risk. A helper's test flag or TESTED_BY edges alone are insufficient; ambiguous links, same-name helpers, call cycles and caller limits remain guarded.
Closes #1109. The interface/type-alias exemption already merged into staging is covered by the React integration regression.
Validation:
--platform linux, matching CI), and Bandit pass.GitHub CI on
8209995: 17 successful checks, including Python 3.10–3.13 (5,056 passed per version, 86.65–86.69% coverage), browser tests, MCP end-to-end tests on Linux/macOS/Windows, and native Windows resource/daemon tests. The manual upgrade-path check is skipped as configured. No merge conflicts with staging.