MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / setup

Function setup

e2e/setup/selfhost-docker.globalsetup.ts:14–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12import { bootSelfhostDocker } from "./selfhost-docker.boot";
13
14export 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}

Callers

nothing calls this directly

Calls 4

waitForHttpFunction · 0.90
claimAndBootFunction · 0.90
bootSelfhostDockerFunction · 0.90
resolveFunction · 0.50

Tested by

no test coverage detected