feat!: the app under test is declared on its target, engines keep only url, identity, environment
Closed
OK
2mo ago+558+558+012345678901234567890123456789-316-316-012345678901234567890123456789
First of three: this moves the app declaration to the target and shrinks the engine's to the defaults it can know. Run-level services and a run-wide port view follow in stacked PRs.
Target.appcarriesurl,environment,identity,command,readyUrl,services. Every field overrides the engine's default; the processes are the target's alone (packages/e2e/src/config/app.ts,mergeAppDeclaration).EngineAppDeclarationisurl,environment,identity. An engine declaringcommand,readyUrl, orservicesisINVALID_CONFIGatdefineEngine;web()rejects them with a pointer at the target.- A target
urlon an engine that declares none isINVALID_CONFIG:exploreandapp.open()navigate wheneverbaseis set, and a device engine cannot open an address. Metro for a debug build is probed withreadyUrl; a release build has nocommand. - The config digest records the merged declaration once, so a URL on the engine or on the target digests alike, with command and service env values reduced to names either way (a run-level
DATABASE_URLnever enters the digest). - Foreign-key hints flip:
webServer, a target-levelurlorcommand, point atapp. Thee2e initpreset, testbed and web-benchmark configs, docs, and the skill follow.
targets: [
{ name: 'web', engine: web({ url: 'http://localhost:8081' }) },
{
name: 'ios',
engine: mobile({ platform: 'ios', app: 'dev.example.app' }),
app: {
command: { executable: 'npx', args: ['expo', 'start'] },
readyUrl: 'http://127.0.0.1:8081/status',
},
},
],
flowchart LR
E[engine.app: url, identity, environment] --> M[merge: target over engine]
T[target.app: + command, readyUrl, services] --> M
M --> R[resolveTargetApp]
R --> P[processes, ports]
R --> C[cache and session identity]
R --> D[config digest, env stripped]
Why: the engine was the only place config could carry a process, so web() grew command and mobile() had no way to start Metro at all, and a web plus native Expo suite had nowhere to put the one dev server both targets share. Cross-target service dedupe stays in this PR so a shared mock still starts once; it goes when config.services lands.