MCPcopy Create free account
hub / github.com/bytebase/bytebase / globalSetup

Function globalSetup

frontend/tests/e2e/framework/global-setup.ts:4–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import { cleanupOrphans, startServer, stopServer } from "./mode-start-new-bytebase";
3
4async function globalSetup() {
5 cleanupOrphans();
6
7 let server: Awaited<ReturnType<typeof startServer>>;
8 try {
9 server = await startServer();
10 } catch (err) {
11 // startServer spawns the server process and creates its temp data dir
12 // before it can fail (e.g. a /healthz timeout when the boot is slow).
13 // Playwright does NOT run globalTeardown when globalSetup throws, so tear
14 // the half-started server down here — otherwise a failed boot orphans a
15 // process group and temp dir that starve every subsequent run's boot.
16 stopServer();
17 throw err;
18 }
19
20 const { baseURL, adminEmail, adminPassword } = server;
21 saveTestEnv({
22 baseURL, adminEmail, adminPassword,
23 project: "", instance: "", instanceId: "", database: "", databaseId: "",
24 });
25}
26
27export default globalSetup;

Callers

nothing calls this directly

Calls 4

cleanupOrphansFunction · 0.90
startServerFunction · 0.90
stopServerFunction · 0.90
saveTestEnvFunction · 0.90

Tested by

no test coverage detected