Skip to content

test(remote-connection): extract shared fixtures from the connection suite - #2252

Merged
thymikee merged 1 commit into
mainfrom
claude/test-fixtures-remote-connection
Sep 3, 2026
Merged

test(remote-connection): extract shared fixtures from the connection suite#2252
thymikee merged 1 commit into
mainfrom
claude/test-fixtures-remote-connection

Conversation

@thymikee

@thymikee thymikee commented Sep 2, 2026

Copy link
Copy Markdown
Member

Summary

Second pass after #2243 on src/__tests__/remote-connection.test.ts. The connect --force family, the proxy open/install pair, and the provider-allocation, persistence-failure, and proxy-disconnect scenarios now take their setup from named exports in the sibling remote-connection.fixtures.ts: writeReplacedProfiles (the old/new profile files), seedPreviousConnection (the lease-old/run-old connection a forced connect replaces), forceConnectFlags, and recordedLeaseRelease/recordedLeaseAllocate (stubs that keep the last request they received). Every test keeps its title and its own assertion lines; none is deleted, merged, or parametrized. No behavior change for operators or clients.

jscpd (--min-tokens 80 --min-lines 8): 211 -> 44 duplicated lines, 10 -> 3 clones. The remaining three are the shared assertion tails of the --force scenarios, which stay in the tests by design. Test file 2,696 -> 2,413 lines; fixtures 160 -> 282.

Validation

  • npx vitest run --project unit-core src/__tests__/remote-connection.test.ts: 50/50 before and after (numTotalTests 50 = 50); assert. calls 213 = 213.
  • pnpm check:quick and pnpm check:fallow: clean.
  • Planted red 1: in connection-runtime.ts, replaced return previousConfigStillSpeaksForPreviousEndpoint(previous, profile.daemonBaseUrl) with return true; vitest -t "re-pointed config path" -> × connect --force does not treat a re-pointed config path's token as the previous endpoint's own / AssertionError: Expected values to be strictly equal. Restored.
  • Planted red 2: appended -x in buildProxyDeviceKey; vitest -t "resolves device key before allocating lease" -> Expected: "ios:mobile:SIM-001" / Received: "ios:mobile:SIM-001-x". Restored.
  • Full affected gate: pending (serialized gate stage will append the result)

Tradeoffs / follow-ups

  • The test-file size ratchet is merge-base-backed with no pins, so no gate edit. The cloud-TTL scenario keeps its inline allocate/heartbeat recorders: its echo shape differs from the shared one.

…suite

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.
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 2.58 MB 2.58 MB 0 B
JS gzip 868.4 kB 868.4 kB 0 B
npm bundled raw 2.58 MB 2.58 MB 0 B
npm bundled gzip 868.4 kB 868.4 kB 0 B
npm tarball 1.02 MB 1.02 MB -2 B
npm unpacked 3.46 MB 3.46 MB 0 B
npm clean-installed 3.46 MB 3.46 MB 0 B

npm unpacked components

Component Base Current Diff
JS / dist source 2.74 MB 2.74 MB 0 B
Apple runner source/project 544.4 kB 544.4 kB 0 B
Apple snapshot presentation source 33.8 kB 33.8 kB 0 B
macOS helper source 54.8 kB 54.8 kB 0 B
Android helper artifacts 43.3 kB 43.3 kB 0 B
Other package files 46.3 kB 46.3 kB 0 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 31.7 ms 32.1 ms +0.3 ms
CLI --help 82.3 ms 83.4 ms +1.1 ms

Top changed chunks: no changes in the largest emitted chunks.

Top changed packed files

No changed packed files.

@thymikee

thymikee commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

READY at 2bad4fca9c685a4d179015c70afe50afffac979a. Independent review found no concrete issues: this is test-only fixture extraction, all 50 scenarios retain their assertion ownership, and session: undefined preserves the no-session branch. No runtime/device evidence is owed. Exact-head CI is fully green (integration, coverage, Repo Guards, Android/Linux/macOS smoke, package/typecheck); npm unpacked size is unchanged.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Sep 2, 2026
@thymikee
thymikee merged commit bbf0b21 into main Sep 3, 2026
17 checks passed
@thymikee
thymikee deleted the claude/test-fixtures-remote-connection branch September 3, 2026 05:59
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-03 06:00 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant