Files
SirStone 1ac46b4969 test: fan out the gates and build shared binaries once
Every Nim test file and every Node test file is already isolated (own temp state
dir, free ports, own server/nginx), so run them FFF_TEST_JOBS at a time (default
half the cores, capped at 8) instead of one at a time. The real server (clean,
leakfault, dispfault) and the leak checker are built once per source+flags and
shared across the parallel files; nimcaches are worktree-local so two checkouts
cannot race on them. The 22 independent fault cases are sharded across
processes. The wall-clock gate files (persistence, tiles; e2e map/fog/fogbench/
perf) still run alone first so their budgets are not measured under the suite's
own load. No test or assertion changes.
2026-11-21 21:40:07 +01:00

17 lines
912 B
JavaScript

// Warm the shared Nim build cache before a test file fans out.
//
// node --test runs every test *file* in its own process; with --test-concurrency > 1 several files
// start at once. lib.mjs cachedNimBuild already makes them share one build per variant, but the
// first file to ask pays the compiler while the others wait on the lock. This script builds the
// three server variants the harnesses use plus (for the server gate) the leak checker, once,
// before the suite starts. `server-only` is for the client e2e: it launches the server but never
// builds the checker. It is a pure cache warm-up: a test file still builds anything missing when
// run on its own.
import { buildChecker } from './leak.mjs'
import { buildServer } from './withserver.mjs'
buildServer()
buildServer({ defines: ['leakfault'] })
buildServer({ defines: ['dispfault'] })
if (!process.argv.includes('server-only')) buildChecker()