mirror of
https://github.com/mvschwarz/openrig.git
synced 2026-11-07 05:56:21 -10:00
Node test suites run inside an OpenRig seat no longer inherit that seat's instance. The daemon and TUI suites now use the same fixture-home and fetch-guard setup as the CLI suite (test/hermetic-env.setup.ts). OPENRIG_* and RIGGED_* instance selectors are cleared before product imports, so tests cannot reach the person's OpenRig home, database or daemon endpoint. Ordinary runs also redirect HOME and the XDG directories and clear CODEX_HOME. With OPENRIG_E2E_REAL_CODEX=1, the real HOME, CODEX_HOME and XDG directories are kept, so the opt-in real-Codex tests run as before. Explicit fixture overrides set after setup still apply. Test-only; no product code changes. Controls against disposable outer audit, SQLite and HTTP targets fail with the old setup and pass with the new one. Not covered: subprocess globals and hardcoded filesystem targets outside the fetch guard.
17 lines
983 B
TypeScript
17 lines
983 B
TypeScript
// B15 — root-invocation hermeticity (r1-reviewed shape: test.projects, NOT the deprecated
|
|
// workspace file). The Node per-package vitest configs carry the hermetic-env setup (D12: scrub
|
|
// connection env, fixture-scoped OPENRIG_HOME, fetch guard), but a bare
|
|
// `npx vitest run packages/cli/test/x.test.ts` from the REPO ROOT found no config and ran
|
|
// UNGUARDED — inside a seat that meant the suites escaped their mocks to the live daemon and
|
|
// produced 13 false failures that cost a QA cycle and a dispatched work item (B15). This root
|
|
// config makes the root invocation resolve each package's own config, so the guarantee genuinely
|
|
// "lives where it cannot be skipped" — and on a carrier vitest will keep reading past v4 (the
|
|
// workspace-file variant was deprecated and would have silently reopened the hole at the upgrade).
|
|
import { defineConfig } from "vitest/config";
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
projects: ["packages/*/vitest.config.ts"],
|
|
},
|
|
});
|