Skip to content

Commit 22ae872

Browse files
thymikeeclaude
andauthored
refactor(platform-apple): colocate sixteen tests with the modules they test (#3657)
* refactor(tests): name platform-apple tests for the module they test Pure moves and renames. Content changes are import specifiers, the Swift sources path in interactions.test.ts, and references to the old paths in the macOS workflow, docs, comments and the command-coverage and fault-matrix evidence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(platform-apple): split the runner response test by the module it covers decodeRunnerResponseBody and its siblings live in runner-contract.ts; parseRunnerResponse lives in runner-exchange.ts. Each half now sits beside its own module's name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(platform-apple): name the runner dispatch-disclosure driver for the runner entry The driver exercises the session executor, command recovery and press-series sequencing against the contracts table, so it takes the runner entry's name. The owning-path string in the contracts fixture follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(platform-apple): name the runner-request conformance drivers for the package and runner entries Pure renames. The runner-requests.json producer paths and the comment that names the runner-side driver follow in the next commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(platform-apple): point runner-requests.json at the renamed conformance drivers The producer paths move with the two drivers; the endsWith contract in the runner-side driver already accepts index-runner-requests.test.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 5356733 commit 22ae872

32 files changed

Lines changed: 155 additions & 147 deletions

‎.device-evidence/CHECKLIST-runner-failures.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ diagnostic a row keys on.
268268
`runner-startup-failure-fixtures.ts` so the rows read as host-gated, not unexamined.
269269

270270
#2680 §4 needs a build that fails for an unrelated reason while naming no signing fact; the
271-
classifier's behaviour there is pinned by `runner-startup-failure-reasons.test.ts` and needs no
271+
classifier's behaviour there is pinned by `runner-xctestrun-startup-failure-reasons.test.ts` and needs no
272272
device claim to hold.
273273

274274
### #2683 — what the phone actually reported

‎.github/workflows/macos.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ jobs:
168168
run: |
169169
pnpm build
170170
pnpm exec vitest run \
171-
packages/platform-apple/src/snapshot-source/native-runtime.test.ts \
171+
packages/platform-apple/src/snapshot-source/cache-native-runtime.test.ts \
172172
packages/platform-apple/src/foldable/fold-helper-cache.test.ts \
173173
packages/platform-apple/src/foldable/simulator-hid-native.test.ts \
174174
packages/capture-kit/src/recording/__tests__/swift-cache-recording-scripts.test.ts

‎contracts/fixtures/runner-requests.json‎

Lines changed: 64 additions & 64 deletions
Large diffs are not rendered by default.

‎docs/adr/0005-ios-runner-interaction-lifecycle.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ What a `RUNNER_BUSY` refusal then costs the caller turns on the daemon's own per
6969
trait, not on any runner-side classification of the command: `RUNNER_COMMAND_TRAITS` in
7070
`packages/platform-apple/src/runner/runner-command-traits.ts`, read through
7171
`isReadOnlyRunnerCommand` where `runAppleRunnerCommand` decides whether to wrap the send in a resend
72-
loop. The asymmetry is shipped, and asserted in `runner-command-busy-resend.test.ts`: a read-only
72+
loop. The asymmetry is shipped, and asserted in `runner-client-busy-resend.test.ts`: a read-only
7373
command treats the refusal as *not yet*, waiting the drain out on the busy-specific budget sized to
7474
outlast it and resending until the runner answers or the window ends; a mutating command treats the
7575
same refusal as *not mine to send again* — one attempt, and the refusal reaches the caller unwrapped

‎docs/ios-runner-protocol-optimizations.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ Acceptance criteria:
2828

2929
iOS simulator validation:
3030

31-
- Unit: `pnpm exec vitest run packages/platform-apple/src/runner/__tests__/runner-command-retry.test.ts`.
32-
- Unit bundle: `pnpm exec vitest run packages/platform-apple/src/runner/__tests__/runner-client.test.ts packages/platform-apple/src/runner/__tests__/runner-session.test.ts packages/platform-apple/src/runner/__tests__/runner-command-retry.test.ts packages/platform-apple/src/runner/__tests__/runner-provider.test.ts`.
31+
- Unit: `pnpm exec vitest run packages/platform-apple/src/runner/__tests__/runner-client-command-retry.test.ts`.
32+
- Unit bundle: `pnpm exec vitest run packages/platform-apple/src/runner/__tests__/runner-client.test.ts packages/platform-apple/src/runner/__tests__/runner-session.test.ts packages/platform-apple/src/runner/__tests__/runner-client-command-retry.test.ts packages/platform-apple/src/runner/__tests__/runner-provider.test.ts`.
3333
- Build: `pnpm build:xcuitest`.
3434
- Manual sim smoke after build:
3535
- `pnpm build`

‎packages/contracts/src/dispatch-disclosure.fixtures.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const DISPATCH_DISCLOSURE_DRIVER_OWNERS: Readonly<Record<string, string>>
4242
'daemon.route.': 'src/__tests__/daemon-composition/request-dispatch-disclosure.test.ts',
4343
'post-action-guard.':
4444
'src/__tests__/daemon-composition/interaction/interaction-dispatch-disclosure.test.ts',
45-
'ios-runner.': 'packages/platform-apple/src/runner/__tests__/runner-dispatch-disclosure.test.ts',
45+
'ios-runner.': 'packages/platform-apple/src/runner/__tests__/index-dispatch-disclosure.test.ts',
4646
'ios-runner.pre-send.':
4747
'packages/platform-apple/src/runner/__tests__/runner-lifecycle-dispatch-disclosure.test.ts',
4848
'ios-runner.transport.':

‎packages/contracts/src/interactor-types.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export const MAESTRO_NON_HITTABLE_FALLBACK_MESSAGE = 'tapped via non-hittable co
107107
* its only producer and the boundary that narrows it
108108
* (readTypeTextBackendResult, packages/platform-apple/src/interactions.ts) drops a
109109
* route it cannot name — so a Swift-side addition would silently vanish. The
110-
* route-parity test in packages/platform-apple/src/core/__tests__/interactions.test.ts
110+
* route-parity test in packages/platform-apple/src/interactions.test.ts
111111
* reads the Swift sources and fails instead.
112112
*/
113113
export const TEXT_ENTRY_ROUTES = [

packages/platform-apple/src/__tests__/runner-requests.test.ts renamed to packages/platform-apple/src/__tests__/index-runner-requests.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { mkdtempForTest } from './tmp-dir.ts';
2626

2727
// Every Apple runner request site outside `runner/`, driven through its production entry point and
2828
// pinned to contracts/fixtures/runner-requests.json. The drives never write a request themselves;
29-
// runner/__tests__/runner-requests.test.ts reads this source to keep it that way.
29+
// runner/__tests__/index-runner-requests.test.ts reads this source to keep it that way.
3030

3131
const APP = 'com.example.app';
3232
const XCTEST_DEVICE: DeviceInfo = { ...IOS_DEVICE, iosPhysicalDeviceBackend: 'xctest' };

packages/platform-apple/src/__tests__/screenshot-backend.test.ts renamed to packages/platform-apple/src/__tests__/interactor-screenshot-backend.test.ts

File renamed without changes.

packages/platform-apple/src/__tests__/watchos-sentinel.test.ts renamed to packages/platform-apple/src/__tests__/interactor-watchos-sentinel.test.ts

File renamed without changes.

0 commit comments

Comments
 (0)