test(warp): neutralize python import fixtures to house naming - #246
Conversation
The python import-resolver, qualified-reference-resolver, and cold-WARP structural-review tests built their fixture trees as `coqui/matcher/...` and `coqui/dev_profiler/...` — the package layout of a private downstream repo, named in a public test suite. Nothing in the resolvers keys off the name, so this costs no coverage. Renamed to Graft's own fixture vocabulary (`pkg/`, `alpha`/`beta` siblings), using `app/` as the root because `pkg/` is already in heavy use in two of these files (67 and 2 references) and reusing it risked namespace collision inside a single test: coqui/matcher -> app/alpha coqui/dev_profiler -> app/beta Scoped to compound path prefixes (`coqui/matcher`, `coqui.matcher`, `"coqui", "matcher"`) rather than bare tokens, because `matcher` also names unrelated **Go** fixtures in qualified-reference-resolver.test.ts (`matcher/sources/pending.go`, 11 references) that must not move. Those are untouched; the diff is 37 insertions / 37 deletions, a pure rename. Package depth is preserved (one root segment, one subpackage), so the relative import under test still resolves the same way: `from ..beta.cli import profile` climbs exactly as `from ..dev_profiler.cli import profile` did. One assertion needed its expected array reordered. It compares against a `.sort()`ed actual, and the literal had been written in the order that sort produced for the old names — `coqui/dev_profiler` sorts before `coqui/matcher`, while `app/alpha` sorts before `app/beta`. The expectation is still exact array equality including order, so the assertion is exactly as strong as before. Verified: 258 test files / 2056 tests pass; pnpm lint and pnpm typecheck clean; no `coqui` token remains under test/, src/, or bin/. No behaviour change, so no CHANGELOG entry.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe tests replace ChangesPython fixture path updates
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This PR only renames test fixture paths and updates the order-sensitive expectation; it does not change production behavior, and no actionable merge-blocking risk remains. Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Why
Three test files built their Python fixture trees as
coqui/matcher/...andcoqui/dev_profiler/...— the package layout of a private downstream repo, named in a public test suite. Nothing in the resolvers keys off the fixture name, so removing it costs no coverage.Surfaced while working in that downstream repo; it is a naming-hygiene fix, not a bug fix.
What changed
Renamed to Graft's own fixture vocabulary (
alpha/betasiblings, already used elsewhere in these suites):coqui/matcherapp/alphacoqui/dev_profilerapp/betaWhy
app/and notpkg/.pkg/is Graft's dominant fixture root (53×pkg/sources.py, 51×pkg/caller.py), but it is already in heavy use inside two of these three files — 67 references inqualified-reference-resolver.test.tsand 2 instructural-review-cold-warp.test.ts. Renaming into it risked a namespace collision within a single test'sknownFilesset.app/appears in none of the three.Two things that made this not a blind find-and-replace
1.
matcheralso names unrelated Go fixtures.qualified-reference-resolver.test.tshas 11 references tomatcher/sources/pending.go,matcher/sources/a.goetc. from Go resolver tests that have nothing to do with this. The rename is therefore scoped to compound prefixes only —coqui/matcher,coqui.matcher,"coqui", "matcher"— never the bare token. The Go fixtures are untouched, confirmed by diff inspection.2. One assertion pinned a sort order that the rename inverted. This assertion compares against a
.sort()ed actual:The literal had been written in the order that sort produced for the old names —
coqui/dev_profilersorts beforecoqui/matcher, whereasapp/alphasorts beforeapp/beta. The two entries are swapped to match. It is still exact array equality including order, so the assertion is exactly as strong as before. This was caught by the suite going red, not by inspection.Semantics preserved
Package depth is unchanged — one root segment, one subpackage — so the relative import under test climbs identically:
The diff is 37 insertions / 37 deletions: a pure rename, no lines added or removed.
Verification
pnpm test— 258 test files, 2056 tests, all passingpnpm lint— cleanpnpm typecheck— cleangit grep -in coqui -- test src bin— no matchesNo behaviour change, so no CHANGELOG entry.
Summary by CodeRabbit
app.alphaandapp.betapackage paths.