Repository navigation
Done
Labels
task:readySpec checked. An agent may implement it once its Depends on allow.
Description
Part of #1634.
Scope
simlockDevices takes a setup function that runs once on every device it leases, with an exec for simctl or adb commands, and the CI page says how to put a device into a known state.
If this goes wrong, a run starts its tests on a device that is not set up, or fails before its tests.
Technical spec
Commit 096519b.
Rows
- Behaviours: B1, B2, B3, B4, B5, B6, B7
- Interfaces: I1, I2
- Existing code: X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13
Facts
| # | Fact | Source |
|---|---|---|
| F1 | On a booted simulator (iOS 27.0, iPhone 17), simctl spawn <udid> defaults write of ReduceMotionEnabled and AppleLanguages takes effect for a program started after it: UIAccessibility.isReduceMotionEnabled and Locale.preferredLanguages change with no reboot, and a clone of the simulator keeps both |
a Swift program spawned before and after the writes, and in a clone: reduceMotion=false langs=["en-PL", "pl-PL"], then reduceMotion=true langs=["de-DE"] twice (2026-11-30) |
| F2 | A clone keeps a permission grant, and simctl keychain <udid> reset works on it |
sqlite3 TCC.db in the clone printed kTCCServiceMicrophone|com.apple.mobilesafari|2; the reset exited 0 (2026-11-30) |
| F3 | The runner's app.permissions is applied on every fresh launch, and device.clearKeychain() resets the iOS simulator's whole keychain, unsupported on Android |
node_modules/@e2e-dev/mobile/README.md:64 and node_modules/@e2e-dev/mobile/dist/device.d.ts:164 at 0.12.9 |
| F4 | The runner passes AppleLanguages and AppleLocale as launch arguments of one app on iOS |
node_modules/@e2e-dev/mobile/dist/launch-arguments.js:3 at 0.12.9 |
Modules touched
Searches: those of the parent's Existing code.
packages/e2e/src/: the option, its check, the run ofsetup,execin a file of its own, the exported types and class, the type-checked samplee2e/slow-e2e-provider.test.ts: B7website/src/content/docs/docs/using-devices/ci.mdx: the docs section, the option's row, the failure table
Rules in play
- ADR 0077 §3: the package imports nothing from
src/; it calls the HTTP route testing.md6: tests drivesimlockDevicesandcreateProvider;exechas no test of its own filetesting.md7: B7 extends the existing slow test, and starts no device of its owndocumentation.md2: the CI page cites no ADR
Tests
Seams: simlockDevices in packages/e2e/src/index.test.ts and createProvider in packages/e2e/src/provider.test.ts, the latter with a node:http server on 127.0.0.1 as the farm's exec route; model on the install cases already there.
- B1: A config gives
setup: it is checked at config load: absent;undefined; async function; plain function; an arrow that returnsexec(...)itself type-checks; a list,nulland a string are refused with I1's message - B2: The runner acquires a device:
setupruns once, after the app and every extra app are installed and beforeacquireends, with I1's context, andsimlock: setup done in <n> msis logged; with nosetup, nothing is run and nothing is logged: iOS; Android;appnamed and not named; plain function; async function; nosetup; the lease is renewed while a longsetupruns - B3:
setupthrows: the device is given back, I1's line is logged, one other device is leased, installed and set up; a second failure fails the acquire with the existingcould not set up a device after 2 triesmessage: throws an Error; rejects; throws a string; first fails and second ends; both fail (two releases); install fails first andsetupfails second; plain function throws - B4: The run is aborted while
setupruns:acquirerejects with the abort's reason without waiting forsetup, the device is given back, no other is leased:setupnever ends;setuprejects because of the abort; anexecin flight is cut;setupis not started when the run aborted during the install - B5:
setupcallsexec: the command runs on this lease's device, andexecends with its stdout and stderr: iOS sends toolsimctl; Android sendsadb;stdinsent and left out; stdout and stderr mixed; a message cut across two chunks; a multi-byte character cut across two chunks; comment lines ignored; the request carries the token and this lease's id - B6:
execfails: it rejects with I2's error for the case: exit 1 with stderr; exit 1 with stdout only; exit 1 with no output; last line over 300 characters; streamerror; JSON error before the start; non-JSON answer; stream ends with neitherexitnorerror; connection refused; aurlwith a username and password reaches the farm with the bearer token, and with the farm unreachable no error, cause or log line holds either (maintainer, 2026-11-30);[]sends no request; the farm's realEXEC_TIMEOUTtext (X11) and other-device refusal (X12), each quoting all the arguments: neither the error's message and causes, nor the log lines, nor the final error and its causes hold a later argument, andfarmMessageholds the text - B7: On a real simulator a
setupwrites a setting throughexecand reads it back: write then readcom.apple.Accessibility ReduceMotionEnabledis1whenacquireends
Done when
pnpm exec vitest run --project unit packages/e2e/src/provider.test.tsand the same forpackages/e2e/src/index.test.tspass.packages/e2e/src/config.sample.tssetssetup, andpnpm typecheckpasses.ci.mdxhas a section "Prepare each device" that covers:setupwith an iOS example (language, reduce motion) and an Android one (animations off), I1's context and I2's failures; thatsetupruns once per device and not between tests; permissions through the runner'sapp.permissions; keychain between tests throughdevice.clearKeychain(); one app's language through launch arguments; and when to use a baseline instead (the same state for every run, saved by an operator on each worker). Its options table has asetuprow, its "When it fails" table the new lines, and it says that other runners useexecover the HTTP API.pnpm --dir website install && pnpm --dir website build && node website/scripts/check-openapi.mjspasses.ci.mdxwarns that the last line a failed command prints reaches the CI log.- B7 needs a real iOS simulator:
scripts/slow-e2e.sh e2e/slow-e2e-provider.test.tspasses.
Out of scope
The parent's Non-goals. Moving budgie or mobile-ci to setup.
Depends on
None.
Written by an agent.
Metadata
Metadata
Assignees
Labels
task:readySpec checked. An agent may implement it once its Depends on allow.
Activity
test: setup runs once after the installs and before acquire ends (#1991)
feat(e2e): setup is timed and logged, and the lease is renewed while …
test: a device whose setup threw is given back and one other is lease…
feat(e2e): a failed setup swaps the device once like a failed install (…
test: an abort while setup runs ends acquire with its reason and give…
feat(e2e): an abort ends acquire at once while setup runs (#1991)
test: setup's exec sends the tool, stdin and reads cut and mixed outp…
test: exec rejects with a DeviceCommandError and keeps the farm's tex…
feat(e2e): exec rejects with a DeviceCommandError that names the tool…
test: a setup that is not a function is refused at config load (#1991)
4 remaining items
test: the exec cases read separate chunks and an abort cuts the exec …
fix(e2e): an abort in setup is not a setup failure, exec names a non-…
fix(e2e): exec keeps the fetch error chain and hides the url's passwo…
fix(e2e): exec hides a url's password in every spelling fetch accepts…
V3RON commentedon Nov 30, 2026
Handoff
Done: PR #1993 at 1f83fca: B1 to B6 and the CI page. R1, R2, R4 to R7, R11, R12, R14 to R16 fixed.
Not done: R17 to R19 (texts in the PR's Status). B7's slow test is written, never run: the review did not pass, so the lane and gate did not start.
Findings: R3, R11, R14, R15 and R17 are one class: a password in
urlreaches the CI log through fetch's error. Each fix hid more spellings, the next check found another. R16 came from the same code.Blocked on: the maintainer picks how to fix R17:
secretsInandhideCredentials(proposed, unproven).checkUrl, whose message must not print it. Changes what a config accepts.Written by an agent.
fix(e2e): exec sends the request to the url without its username and …
fix(e2e): the spelling check of exec's credentials is its own functio…
feat(e2e): a setup function runs once on every leased device (callsta…