Commit Graph

3 Commits

Author SHA1 Message Date
Michał Pierzchała 59d28e8446 refactor: add provider-first device lab tests (#542)
* refactor: add provider-first device lab tests

* refactor: tighten device lab provider seams

* test: cover provider lab contracts

* docs: record device lab harness direction

* ci: run device lab integration tests

* test: move device lab under integration

* test: extract device lab helpers

* refactor: centralize apps filter defaults

* test: drop lab-covered unit tests

* test: fold platform happy paths into device lab

* test: reuse device lab helpers

* test: move device lab to in-process harness

* test: replace session handler cases with device lab

* test: harden device lab scenario contracts

* docs: define unit test retention policy

* test: expand provider device lab coverage

* test: harden provider device lab coverage

* test: cover manifest install and runner session contracts

* chore: remove unused provider cleanup code

* test: split android find device lab scenario

* test: track provider lab architecture progress

* test: clarify provider lab roadmap progress

* test: advance provider lab session coverage

* test: move menubar click routing to device lab

* test: move menubar snapshots to device lab

* refactor: centralize screenshot flag plumbing

* refactor: colocate screenshot flag metadata

* test: cover all public commands in device lab

* test: move macos wait success to device lab

* test: drop redundant perf and diff units

* test: move push payload paths to device lab

* test: move network parsing to device lab

* test: move log cleanup to device lab

* test: move log restart and boot to device lab

* test: move ios physical boot to device lab

* test: cover perf startup in device lab

* test: extract android and ios device lab worlds

* test: trim device lab world surface

* test: split snapshot capture unit coverage

* test: deepen device lab coverage and trim handler units

* test: clean up device lab migration scaffolding

* test: report device lab public command coverage

* refactor: make Apple provider seams semantic

* refactor: tighten device inventory and Linux provider seams

* refactor: tighten request provider scoping

* refactor: add semantic macos host provider

* test: broaden device lab find coverage

* test: cover workflow flags in device lab

* refactor: promote linux input provider seam

* test: clarify device lab flag coverage

* test: classify snapshot force-full progress

* test: enforce device lab progress in ci

* test: stabilize device lab ci

* test: move packaged metro smoke to integration

* test: drop stale provider seam coverage

* test: harden provider scope regression coverage

* refactor: remove stale platform barrels

* refactor: keep linux clipboard and screenshots semantic

* refactor: move macos host tools behind provider

* fix: honor remote artifact output paths

* test: deepen runtime coverage for daemon and runner paths

* test: share loopback test helpers

* refactor: make daemon runtime importable

* fix: honor replay target metadata

* chore: tighten final device lab quality gates

* test: share device lab setup helpers

* test: remove generic apple lab fallback

* test: deduplicate device lab helpers

* chore: tighten fallow duplication signal

* refactor: share apple diagnostic helpers

* fix: detect active android ime during fill verification

* test: consolidate provider-backed integration suite

* ci: fix fallow and iOS smoke setup

* chore: consolidate cleanup after ci fixes

* test: split vitest unit and integration projects

* docs: mention MCP discovery metadata

* docs: add agent skills context pointers

* fix: close provider recording coverage gaps

* fix: restore mcp compatibility smoke

* test: cover provider edge regressions

* test: consolidate loopback helpers

* docs: remove stale provider routing reference

* fix: harden final provider review issues

* chore: defer mcp cleanup from provider refactor
2026-05-18 14:50:52 +02:00
Michał Pierzchała 9eb0604065 refactor: migrate session.ts orchestrator to vitest + drop node:test (#284) (#302)
Remove all test-only DI parameters from handleSessionCommands (signature
drops from ~30 params to 5: req, sessionName, logPath, sessionStore,
invoke) and from the remaining sub-handlers (session-inventory,
session-observability, session-replay, session-close, session-state).

Migrate all 89 remaining node:test unit test files to vitest. Tests that
passed DI overrides now use vi.mock instead. Update vitest.config.ts to
include *.test.ts alongside *.vitest.ts, and remove the dual-runner
node --test from package.json scripts.

Add a permanent CI lint guard that fails if optional typeof DI seams
reappear in production code.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 16:39:59 +01:00
Michał Pierzchała d1d2f3852a refactor: migrate leaf modules from test-only DI to vitest mocking (#289)
* refactor: migrate leaf modules from test-only DI to vitest mocking

Drop optional DI parameters from 6 production modules that existed
solely as test seams. Replace with vi.mock() in new vitest test files.

Production files simplified:
- recording-telemetry.ts: remove writeTelemetry?
- find.ts: remove dispatch?, use dispatchCommand directly
- install-source.ts: remove entire deps? object (7 params)
- session-runtime-command.ts: remove clearRuntimeHints?
- android-system-dialog.ts: remove 4 DI params, simplify internals
- record-trace-recording.ts: remove writeRecordingTelemetry from deps

Closes #281

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: restore DI seams broken by premature removal, fix test script

- request-router.ts: remove 4 dead DI params (snapshotAndroidUi,
  reopenAndroidApp, readAndroidAppState, execCommand) from
  RequestRouterDeps since recoverAndroidBlockingSystemDialog no
  longer accepts them
- session-runtime-command.ts: restore clearRuntimeHints? param that
  handleSessionCommands threads through — removing it broke callers
  that override the seam
- session.ts: restore clearRuntimeHints pass-through to runtime branch
- session.test.ts: restore the end-to-end runtime clear DI test
- package.json: include vitest in the default `test` script

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: rename *.vitest.test.ts → *.vitest.ts to avoid node:test collision

Node's default test discovery matches *.test.ts, which picked up vitest
files and crashed. Rename to *.vitest.ts so the two runners have disjoint
file sets without needing find-based exclusions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: use vi.mocked().mock.calls instead of module-level mutable state

Replace manual clearCalls array with direct assertion on the mock,
consistent with the pattern used in request-router-android-modal.vitest.ts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 10:01:46 +01:00