|
3 | 3 | // (cloud.boot.ts — emulated WorkOS + Autumn + the app's real dev stack, the |
4 | 4 | // same recipe the dev CLI uses). Set E2E_CLOUD_URL to attach to a running |
5 | 5 | // stack instead. |
| 6 | +import { mkdirSync } from "node:fs"; |
| 7 | +import { resolve } from "node:path"; |
| 8 | + |
6 | 9 | import { claimAndBoot } from "../src/ports"; |
7 | 10 | import { E2E_COOKIE_PASSWORD, E2E_WORKOS_CLIENT_ID } from "../targets/cloud"; |
8 | 11 | import { waitForHttp } from "./boot"; |
9 | 12 | import { bootCloud } from "./cloud.boot"; |
10 | 13 | import { bootMotel, motelExporterEnv } from "./motel"; |
| 14 | +import { RUNS_DIR } from "../src/scenario"; |
| 15 | + |
| 16 | +// dev-db + vite dev stdout/stderr, swept into the failure-only artifact |
| 17 | +// upload (CI uploads e2e/runs/**): see .github/workflows/ci.yml. A |
| 18 | +// mid-shard OOM abort or a 500 cascade otherwise leaves no trace: boot.ts |
| 19 | +// defaults to stdio "ignore" unless E2E_VERBOSE=1. Skip the file when |
| 20 | +// E2E_VERBOSE is set so local `E2E_VERBOSE=1` keeps its inherited, |
| 21 | +// live-in-terminal output (boot.ts prioritizes logFile over E2E_VERBOSE, so |
| 22 | +// passing both would silently swallow the verbose stream into the file). |
| 23 | +const bootLogFile = process.env.E2E_VERBOSE |
| 24 | + ? undefined |
| 25 | + : resolve(RUNS_DIR, "cloud", ".server", "boot.log"); |
11 | 26 |
|
12 | 27 | export default async function setup(): Promise<(() => Promise<void>) | void> { |
13 | 28 | if (process.env.E2E_CLOUD_URL) { |
14 | 29 | await waitForHttp(process.env.E2E_CLOUD_URL); |
15 | 30 | return; |
16 | 31 | } |
17 | 32 |
|
| 33 | + if (bootLogFile) mkdirSync(resolve(bootLogFile, ".."), { recursive: true }); |
| 34 | + |
18 | 35 | // Suite-owned trace store — every run captures distributed traces. Booted |
19 | 36 | // once outside the retry: it binds its own OS-assigned port (not a claimed |
20 | 37 | // one), so an EADDRINUSE on the claimed block doesn't implicate it. |
@@ -50,6 +67,7 @@ export default async function setup(): Promise<(() => Promise<void>) | void> { |
50 | 67 | workosClientId: E2E_WORKOS_CLIENT_ID, |
51 | 68 | cookiePassword: E2E_COOKIE_PASSWORD, |
52 | 69 | publicUrl, |
| 70 | + logFile: bootLogFile, |
53 | 71 | // Server + browser spans → the suite's motel. The app's exporter is |
54 | 72 | // endpoint-agnostic, so the same layer that ships prod traces to |
55 | 73 | // Axiom ships e2e traces to the suite store — "why was that page |
|
0 commit comments