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

Function setup

e2e/setup/cloudflare.globalsetup.ts:8–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6import { bootCloudflare } from "./cloudflare.boot";
7
8export default async function setup(): Promise<(() => Promise<void>) | void> {
9 if (process.env.E2E_CLOUDFLARE_URL) {
10 await waitForHttp(`${process.env.E2E_CLOUDFLARE_URL}/api/account/me`);
11 return;
12 }
13
14 // Claim, boot, and retry on EADDRINUSE (Linux-CI ephemeral squatter between
15 // probe and bind); the claimed port is published via env for the workers.
16 const { teardown } = await claimAndBoot(
17 [{ envVar: "E2E_CLOUDFLARE_PORT", offset: 5, label: "cloudflare wrangler dev" }],
18 async (ports) => {
19 const procs = await bootCloudflare({ port: ports.E2E_CLOUDFLARE_PORT! });
20 return { teardown: procs.teardown, value: procs };
21 },
22 { label: "cloudflare" },
23 );
24 return teardown;
25}

Callers

nothing calls this directly

Calls 3

waitForHttpFunction · 0.90
claimAndBootFunction · 0.90
bootCloudflareFunction · 0.90

Tested by

no test coverage detected