()
| 24 | * the port is unavailable, tracing is simply off (null) and targets skip |
| 25 | * the exporter env. */ |
| 26 | export const bootMotel = async (): Promise<SuiteMotel | null> => { |
| 27 | const dataDir = join(e2eDir, "runs", ".motel"); |
| 28 | rmSync(dataDir, { recursive: true, force: true }); |
| 29 | mkdirSync(dataDir, { recursive: true }); |
| 30 | |
| 31 | let procs: BootedProcesses | null = null; |
| 32 | // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: optional infrastructure; a motel-less host still runs the suite |
| 33 | try { |
| 34 | procs = bootProcesses( |
| 35 | [ |
| 36 | { |
| 37 | cmd: "bunx", |
| 38 | args: ["motel", "server"], |
| 39 | cwd: e2eDir, |
| 40 | env: { |
| 41 | MOTEL_OTEL_BASE_URL: MOTEL_URL, |
| 42 | MOTEL_OTEL_DB_PATH: join(dataDir, "telemetry.sqlite"), |
| 43 | }, |
| 44 | }, |
| 45 | ], |
| 46 | { label: "motel" }, |
| 47 | ); |
| 48 | await waitForHttp(`${MOTEL_URL}/api/health`); |
| 49 | console.log(`[e2e] traces → suite motel at ${MOTEL_URL}`); |
| 50 | return { url: MOTEL_URL, teardown: procs.teardown }; |
| 51 | } catch (error) { |
| 52 | console.warn(`[e2e] motel unavailable, tracing off: ${String(error)}`); |
| 53 | await procs?.teardown(); |
| 54 | return null; |
| 55 | } |
| 56 | }; |
| 57 | |
| 58 | /** Exporter env for a target's dev stack: server spans via the app's |
| 59 | * endpoint-agnostic Axiom exporter, browser spans via packages/react's |
no test coverage detected