Skip to content

refactor(move): move daemon-shaped test helpers under src/daemon/__tests__/support - #3484

Merged
thymikee merged 1 commit into
refactor/test-kitfrom
refactor/test-kit-daemon-support
Oct 12, 2026
Merged

thymikee merged 1 commit into
refactor/test-kitfrom
refactor/test-kit-daemon-support

Conversation

@thymikee

@thymikee thymikee commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Summary

Daemon extraction PR 10b (test-kit, stacked on #3483): moves the four daemon-shaped test helpers — session-factories.ts, store-factory.ts, device-claim-store.ts, screen-recording-live-handle.ts, the helpers that import src/daemon/* types and stores — from src/__tests__/test-utils/ to src/daemon/__tests__/support/, so they travel with the daemon when PR 11 runs git mv src/daemon packages/daemon/src. Their root-helper imports were already rewritten to @agent-device/test-kit/* by the layer below; no other content change. Non-daemon importers (6 files: src/platform-runtime-gateway.test.ts, src/__tests__/lease-provider-profile-fields.test.ts, src/commands/cli-grammar/flag-declaration-admission.test.ts, and three provider-scenario files) import them from the support path for now; PR 11 turns that into a package fixture subpath. 228 files, all one-line specifier rewrites.

Validation

Tested at 483d3c0ba (this head). Serially on this exact commit: pnpm format + check:quick, pnpm check:layering, pnpm check:gate-manifest, pnpm check:fallow --base origin/main (clean on 539 changed files), pnpm check:affected --run (all runnable checks passed), plus eager-closure budgets / test-file-size ratchet. Unit-suite parity was measured on this identical tree (byte-for-byte): 1574 files both sides vs origin/main, zero tests lost, +34 additions all from #3483's new eager-closure entry assertions.
Risk: the 6 non-daemon importers now reach into the daemon test tree; tracked for PR 11's export, listed in the plan's residue report.

View guided diff Turn on auto-fix

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.17 MB 5.17 MB 0 B
Package (unpacked) 5.17 MB 5.17 MB 0 B
Package (download) 1.55 MB 1.55 MB -7 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 26.5 ms 26.9 ms +0.4 ms
CLI --help 76.7 ms 76.6 ms -0.1 ms

@thymikee
thymikee force-pushed the refactor/test-kit-daemon-support branch from 483d3c0 to 38d2569 Compare October 12, 2026 11:43
@thymikee

Copy link
Copy Markdown
Member Author

Rebased onto refactor/test-kit head c582e8b62 (on main e155fbfac); new head 38d256979. Conflicts in the two files #3472 rewrote were resolved by taking main's version and re-running the T2 codemod, not hand-merging: session-appstate-device-runtime.test.ts kept main's rewrite, then the codemod repointed store-factory to src/daemon/__tests__/support/ and runtime-operation-facts to @agent-device/test-kit/runtime-operation-facts; session-state.test.ts was deleted by #3472 on main, so the deletion was kept. Re-ran the T2 codemod repo-wide: 2 files codemodded (session-appstate-device-runtime.test.ts, session.test.ts; 2 specifiers), 0 remaining importers of the four helpers' old src/__tests__/test-utils/ paths (grep = 0). Gates green on this head: install+build, format, check:quick, check:layering, check:gate-manifest, eager-closure budgets + test-file-size ratchet (841 passed), check:affected --run (all runnable checks passed; one daemon-registration-owner graceful-stop timing flake on the first run passed standalone and on the full rerun); test-kit boundary hard-rule check clean. Vitest fullName parity vs main e155fbf: 13396 -> 13430, 0 lost, +34 all eager-closure first-introduced-entry assertions from #3483's new package.

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at 38d2569. The move looks clean in the diff, and there are no conflicts.

Not blocking: six test files outside src/daemon now import from src/daemon/tests/support, for example https://github.com/callstack/agent-device/blob/38d2569/src/platform-runtime-gateway.test.ts#L22. They already used the daemon session and store types before the move, so nothing needs to change. If the repo has a layering rule about reaching into tests directories, please check that it allows these paths. You can take this or leave it.

I did not run the typecheck or tests locally. This review is based on reading the diff and searching for imports. I did not check the codemod claim beyond the diff itself. I also did not look at the one production line (+1/-1).

CI is still pending. Only Smoke Tests is queued, so no check has failed. The diff touches tests, docs and that one production line, and it moves no runtime code. Before merge, Smoke Tests needs to finish green, and this stack needs to merge after #3483.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 12, 2026
@thymikee
thymikee added this pull request to stack #3499 October 12, 2026 12:44
@thymikee
thymikee marked this pull request as ready for review October 12, 2026 13:02
@thymikee
thymikee merged commit 945080f into main Oct 12, 2026
20 checks passed
@thymikee
thymikee deleted the refactor/test-kit-daemon-support branch October 12, 2026 13:03
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