test(remote-connection): extract shared fixtures from the connection suite - #2243
Conversation
Size Report
npm unpacked components
Startup median (7 runs, lower is better):
Top changed chunks: no changes in the largest emitted chunks. Top changed packed filesNo changed packed files. |
|
CODE REVIEW CLEAN, CI NOT READY at this exact head. The fixture extraction preserves client/Metro/state defaults and per-scenario overrides, keeps all 50 tests and 213 assertions, materially reduces duplication, and the test family shrinks overall. No code finding. Linux Smoke failed only because apt dependency installation hit the six-minute action timeout before checkout/build/product tests ran; rerun or otherwise clear that infrastructure failure before readiness labeling. The PR body’s full affected gate is also still pending and its local evidence predates the final head. |
|
Updated exact-head status: code review remains clean at b5d4097, but the branch is not ready. Current main replaced the manual test-file pin map with the history-backed ratchet, so rebase onto current main, keep main's ratchet, and drop this PR's now-obsolete pin-lowering change. Then rerun exact-head CI. The Linux Smoke failure is infrastructure-only: apt dependency installation hit the exact six-minute timeout before checkout, build, or product tests ran. |
…suite The connection suite repeated its setup inline: the fake AgentDeviceClient, the Metro prepare reply, the temp state directory, and the persisted connection state literal with its version, profile hash, and timestamps. Those move to a sibling fixtures module as named exports; every scenario keeps its title, its inputs, and its own assertions. jscpd (--min-tokens 80 --min-lines 8): 535 -> 211 duplicated lines, 27 -> 10 clones. Test count 50 -> 50, assert calls 213 -> 213.
b5d4097 to
91fffd5
Compare
|
Branch blocker resolved at
Exact-head GitHub CI is now authoritative; the earlier Linux setup timeout belongs to the superseded head. |
|
READY at |
|
…suite (#2252) Second pass after #2243: the connect --force family, the proxy open/install pair, and the provider-allocation, persistence-failure, and proxy-disconnect scenarios build their setup from writeReplacedProfiles, seedPreviousConnection, forceConnectFlags, recordedLeaseRelease, and recordedLeaseAllocate. Titles and assertion lines are unchanged; 50 tests before and after.
Summary
Extracts the repeated remote-connection test setup into a sibling fixture module while preserving every scenario, input, override, and assertion.
The suite remains at 50 tests and 213 assertions. The extraction reduces the test file from 2,973 to 2,696 lines and removes the obsolete manual size-pin adjustment now superseded by main's history-backed ratchet.
Validation
At
91fffd5f37b1017a7df94500d75f82df79739780:pnpm vitest run --project unit-core src/__tests__/remote-connection.test.ts— 50/50 passed.pnpm check:affected --run— formatting, lint, typecheck, fallow, and related tests all passed.pnpm install --frozen-lockfileandpnpm buildcompleted successfully.Touched scope: two test files; no production, runtime, package, documentation, or device-facing behavior.