mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-08-25 16:33:14 +00:00
The packages/cli move (dc97ab49, Jul 26) forked vitest.config.ts and the test script off main before three since-merged CI-stability fixes existed there, and #921's later "port upstream fixes" pass (f3f5814b) missed all three since it only cross-referenced one specific main commit: -30037b33: global vitest testTimeout raised from the 5s default to 30s (real-I/O tests exceed 5s under CI runner load) -8c758ddf: file-level 30s timeout on cli-status-menubar.test.ts (spawns the real CLI; individual cases observed needing 6-8s on a shared 2-core runner) -4ca2d482: cache-refresh-lock tests excluded from the parallel `test` run and quarantined behind a serial `test:locks` script (they contend for the fork pool with the spawned-subprocess tests and starve everyone under load) None of this showed up until #923 wired `npm test --workspace=codeburn` into CI for the first time, which then failed deterministically at the vitest default 5000ms on exactly the three test categories these fixes cover. Ports all three, matching main's current config/script.
21 lines
1.1 KiB
TypeScript
21 lines
1.1 KiB
TypeScript
import { defineConfig } from 'vitest/config'
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
// Runs once per worker before any test. Scrubs the developer's shell so
|
|
// session-discovery env vars (CLAUDE_CONFIG_DIRS, HOME, XDG_*, every
|
|
// provider-specific *_HOME) don't bleed real local data into fixtures.
|
|
setupFiles: ['./tests/setup/env-isolation.ts'],
|
|
// Real-I/O tests (session parses, sqlite fixtures, worker pools) exceed the
|
|
// 5s default under CI runner load; a hung test still fails at 30s.
|
|
testTimeout: 30_000,
|
|
// A handful of integration tests exercise real servers, spawned CLI
|
|
// subprocesses and real filesystem locks. Under a saturated full-suite run
|
|
// an fs/socket op can starve and the operation fails closed (correct, but
|
|
// an environmental blip, not a logic error), so a different one trips each
|
|
// run. A small retry rides out that starvation; a real regression is
|
|
// deterministic and fails every attempt. Tests that need more headroom set
|
|
// a higher retry locally (it overrides this).
|
|
retry: 2,
|
|
},
|
|
})
|