Repository navigation
refactor(capture-kit): colocate fifteen tests with the modules they test - #3654
Conversation
Size Report
Startup median (7 runs, lower is better):
|
|
This PR is ready at 90ce86d. Not blocking: the rename to |
Pure moves and renames. Import changes are specifier-only: self-package and barrel imports become the defining module, and the moved freshness and action-shelf tests drop their cross-directory prefixes. The transitions and rows fixtures move with the tests that use them; the transitions fixture export follows its file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ding scripts test The overlay and contact-sheet unsupported-host checks cover overlay.ts and contact-sheet-frames.ts; they now sit beside those modules' tests. The Swift typecheck and overlay export cases stay in swift-cache-recording-scripts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
90ce86d to
991ab1a
Compare
|
The earlier review of 90ce86d was clean, and the code at 991ab1a is still clean. The diff only moves tests, edits one fixture export path and updates one workflow test path. The export names are unchanged and the new paths resolve. The Smoke Tests, Mutants, Compatibility & Provenance and Coverage jobs fail. I could not read their logs, so I can't say why they fail. Nothing in this diff points at them, but Coverage and Compatibility could touch moved tests or the manifest. I did not run vitest, check:package or check:layering, and I did not read the one-line projection.ts hunk. Please confirm the four failing jobs are unrelated, or share the log lines if they are not. No other change is needed before merge. |
Summary
Colocation renames for capture-kit: 15 test files that were not beside a module they are named for. Two fixtures follow the tests that use them. No fixture export is dropped here (the remaining capture-kit fixture exports need test-kit and come later); the only package manifest edit is the new target path of the
snapshot-presentation-ios-transitions-fixturesexport.The rule thread's colocation baseline and R83 list are not on main yet. This PR only shrinks what the seed will contain: capture-kit 15 → 0 colocation offenders.
Commits
refactor(tests): name capture-kit tests for the module they test— puregit mv. Content changes are import specifiers only (self-package and barrel imports become the defining module;../snapshot-freshness/and../../../ios-snapshot-engine/prefixes drop), plus references to the old paths (macOS workflow, ADR 0026, a comment inprojection.ts).oxfmtalso collapsed one import inrecovery.test.tsonto a single line.refactor(capture-kit): split the host-support checks out of the recording scripts test— the only non-move.Renames
capture-admission/__tests__/screen-recording-boundary-faultsdurable-capture-resource-boundary-faultsdurable-capture-resource.ts(createDurableCaptureResource)ios-snapshot-engine/conformanceengine-conformanceengine.tsios-snapshot-engine/eligibility-parityengine-eligibility-parityengine.tsios-snapshot-engine/propertiesengine-propertiesengine.tsios-snapshot-engine/mappingsemantic-index-mappingsemantic-index.tsios-snapshot-engine/presentationsemantic-index-presentationsemantic-index.tssnapshot/__tests__/ax-digestsnapshot-evidence-ax-digestsnapshot-evidence.ts(computeAxDigest)snapshot/__tests__/snapshot-actions-identitysnapshot-diff-actions-identitysnapshot-diff.tssnapshot/snapshot-presentation/warningsquality-warningsquality-warnings.tssnapshot-sibling-sized-chromesnapshot-occlusion-sibling-sized-chromesnapshot-occlusion.ts(its header already calls it a family ofsnapshot-occlusion.test.ts)snapshot/__tests__/snapshot-freshnesssnapshot/snapshot-freshness/android.test.tssnapshot-freshness/android.tssnapshot/__tests__/snapshot-freshness-recoverysnapshot/snapshot-freshness/recovery.test.tssnapshot-freshness/recovery.tssnapshot/snapshot-presentation/ios/action-shelfios-snapshot-engine/action-shelf.test.tsios-snapshot-engine/action-shelf.ts(behavior reached throughbuildIosInteractiveSnapshotPresentationinsemantic-index.ts)snapshot/snapshot-presentation/ios/rowsios-snapshot-engine/rows.test.tsios-snapshot-engine/rows.ts(same)recording/__tests__/recording-scriptsswift-cache-recording-scripts,overlay-host-support,contact-sheet-frames-host-supportswift-cache.ts(it locates the Swift scripts),overlay.ts,contact-sheet-frames.tsThe
engine-*tests previously imported throughios-snapshot-engine/index.ts; they now importengine.ts/types.tsdirectly.rows.fixtures.tsandtransitions.fixtures.tsmoved with their tests (the oldsnapshot-presentation/ios/directory is gone); the transitions fixture is still exported for one root test and is a later test-kit candidate.Judgment call to check:
swift-cache-recording-scriptstype-checks and exercises the Swift sources underapple/runner/.../RecordingScripts;swift-cache.tsis the TS module that owns that directory, so I named it for that. If you'd rather count it as a non-module test, say so and I'll leave it out of the baseline instead.Test-count parity (
vitest --reporter=json, passed/total)screen-recording-boundary-faults4/4durable-capture-resource-boundary-faults4/4conformance8/8engine-conformance8/8eligibility-parity4/4engine-eligibility-parity4/4properties5/5engine-properties5/5mapping1/1semantic-index-mapping1/1presentation21/21semantic-index-presentation21/21ax-digest10/10snapshot-evidence-ax-digest10/10snapshot-actions-identity4/4snapshot-diff-actions-identity4/4warnings17/17quality-warnings17/17snapshot-sibling-sized-chrome25/25snapshot-occlusion-sibling-sized-chrome25/25snapshot-freshness10/10snapshot-freshness/android10/10snapshot-freshness-recovery5/5snapshot-freshness/recovery5/5action-shelf3/3action-shelf3/3rows2/2rows2/2recording-scripts8/8swift-cache-recording-scripts6/6 +overlay-host-support1/1 +contact-sheet-frames-host-support1/1Selection: all paths are under
packages/*/src/**, which theunit-coreinclude covers. Becausepackages/capture-kit/package.jsonchanged,check:affected --runfell back to the full test set, so every moved file ran in context (15,485 tests passed).vi.mockeffectivenessNone of the moved files use
vi.mock(the onlyvi.mockin the touched directories is inoverlay.test.ts, which did not move).Surface
exportscounts before → after: capture-kit 83 → 83. Thesnapshot-presentation-ios-transitions-fixturesexport keeps its key and points at the moved file; no subpath added or removed, no barrels.Gates
pnpm check:quick,check:layering,check:fallow,check:gate-manifestpass;pnpm formatleaves a clean tree.pnpm check:affected --runran the full set: 15,485 passed, 1 failed —scripts/__tests__/eager-closure-budgets.test.ts > no APPROVED_OVER_CEILING row is stale(packages/daemon/src/index.ts). That failure is not from this change: it fails identically on a checkout oforigin/mainplus only the PR #3648 renames (no daemon file touched), so it comes from the daemon single-entry work already on main (#3633). The daemon thread owns the fix.🤖 Generated with Claude Code