feat!: the app is declared on its target; engines only drive it
Merged
OK
2mo ago+2438+2438+0123456789012345678901234567890123456789-2880-2880-0123456789012345678901234567890123456789
The app under test is declared on its target, and nowhere else. Engines only drive it. This is the first half of #648: the app move and the runtime fixes, without defineService, which follows in #648 on top of this branch.
targets: [
{ name: 'chromium', engine: web(), app: { url: 'http://127.0.0.1:0', command: { executable: 'pnpm', args: ['dev', '--port', '{port}'] } } },
{ name: 'ios', engine: mobile({ platform: 'ios' }), app: { bundleId: 'dev.shop.app', appPath: './build/Shop.app', permissions: { camera: 'grant' } } },
],
The app on the target
target.appholds{ url | bundleId, appPath, identity, environment, launchArguments, permissions, command, readyUrl }.web({ url }),mobile({ app }), an app key directly on the target, andservicesanywhere are unknown keys: a plain break, no migration messages.defineEnginegetsvalidateApp:web()needsapp.url,mobile()needsbundleIdorappPath, andapp.urlon a mobile target fails as not supported yet with a platform-specific note.defineEngine({ app })is an unknown key.prepareandinitreceive the resolved app asinfo.app.requires: ['browser' | 'native-app']is derived from the target's app, not declared by engines.- Replay-cache and session keys are byte-identical to main, pinned by
packages/e2e/tests/unit/target-identity.test.ts.
Services wait for the next release
- There is no
serviceskey in this version; the docs carry a callout in place of the old services sections. Nothing in the repo used them.
Refused at load
- a port-0
app.urlwith nothing to start on it reuseExistingon a free port: what already answers cannot serve the port the run assigns
e2e mcp
- A cancelled or disconnected
open_session, or a server shutting down, aborts an open still starting its app command and stops what it started (CANCELLED). - A shared start that every waiting session gave up on is abandoned, and the next session starts it afresh.
flowchart LR
T[target.app] --> C[checkTargetApp: shape]
C --> V[engine.validateApp: what the platform needs]
V --> R[resolveTargetApp: base URL, identity, command with port]
R --> P[allocateAppPorts]
P --> W[workers: assignPorts from the bootstrap]
Verified
Ran it locally: yes
- Testbed, built CLI (
pnpm test:testbed), its config declaringapp: { url, command }on the target:target "web" command ready 88ms, 14 files, 70 tests passed, 1 skipped, the command stopped at the end. packages/e2e/tests/unit/target-identity.test.tspins the cache and session digests of the same apps declared the old way.