INNER CODE UNIT · TypeScript

spawnTestProcess

SveltyCMS/SveltyCMS · scripts/benchmark-matrix/index.ts:426

function spawnTestProcess(
  file: string,
  serverEnv: Record<string, string>,
  baseUrl: string,
  runId: string,
): Promise<{ code: number; durationMs: number; output: string }> {
  return new Promise((resolve) => {
    const testStartTime = performance.now();
    const p = spawn("bun", ["test", `tests/benchmarks/${file}`, "--timeout", "300000"], {
      stdio: ["inherit", "pipe", "pipe"],
      shell: process.platform === "win32",
      env: {
        ...serverEnv,
        API_BASE_URL: baseUrl,
        BENCHMARK_MATRIX: "1",
        BENCHMARK_RUN_ID: runId,
        // 🏷️ Production-mode marker for the benchmark server (bun test overrides
        // NODE_ENV/TEST_MODE in child processes, so this survives as the signal)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…