()
| 12 | import { bootSelfhostDocker } from "./selfhost-docker.boot"; |
| 13 | |
| 14 | export default async function setup(): Promise<(() => Promise<void>) | void> { |
| 15 | if (process.env.E2E_SELFHOST_DOCKER_URL) { |
| 16 | await waitForHttp(process.env.E2E_SELFHOST_DOCKER_URL); |
| 17 | return; |
| 18 | } |
| 19 | |
| 20 | // Claim, boot, and retry on EADDRINUSE (Linux-CI ephemeral squatter between |
| 21 | // probe and bind); the claimed port is published via env for the workers. |
| 22 | const { teardown } = await claimAndBoot( |
| 23 | [{ envVar: "E2E_SELFHOST_DOCKER_PORT", offset: 5, label: "selfhost docker" }], |
| 24 | async (ports) => { |
| 25 | const port = ports.E2E_SELFHOST_DOCKER_PORT!; |
| 26 | const procs = await bootSelfhostDocker({ |
| 27 | port, |
| 28 | webBaseUrl: `http://localhost:${port}`, |
| 29 | admin: SELFHOST_ADMIN, |
| 30 | logFile: resolve( |
| 31 | fileURLToPath(new URL("../", import.meta.url)), |
| 32 | "selfhost-docker.boot.log", |
| 33 | ), |
| 34 | }); |
| 35 | return { teardown: procs.teardown, value: procs }; |
| 36 | }, |
| 37 | { label: "selfhost-docker" }, |
| 38 | ); |
| 39 | return teardown; |
| 40 | } |
nothing calls this directly
no test coverage detected