forked from lidge-jun/opencodex
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbunfig.toml
More file actions
23 lines (23 loc) · 1.58 KB
/
Copy pathbunfig.toml
File metadata and controls
23 lines (23 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Scope `bun test` discovery to opencodex's own suite.
#
# Vendored trees under devlog/ (opencode-cursor, _chase/_litellm, _cca …) ship their own
# *.test.ts / *.spec.ts files with deps we don't install (react/jsx-dev-runtime, @playwright/test),
# so a bare `bun test` — or `bun test tests/` (a substring filter that also matches
# devlog/opencode-cursor/tests/) — drags them in and reports hundreds of spurious failures.
# `root` pins discovery to ./tests so every invocation stays on the real suite.
# File-level `--parallel` has no bunfig key; `scripts/test.ts` passes it for `bun run test`.
# The npm script already uses `bun test ./tests/`; this makes a bare `bun test` behave the same.
[test]
root = "tests"
# Sandboxes HOME/OPENCODEX_HOME/CODEX_HOME and arms the real-home write guard for every
# invocation THAT READS THIS FILE, including a bare `bun test <file>` that skips
# `scripts/test.ts`. A test once overwrote a real user config through that unwrapped path;
# see devlog/_fin/260730_codex_rs_upstream_v2_live_handoff/070.
#
# That qualifier is load-bearing. Bun resolves bunfig.toml from the CURRENT WORKING
# DIRECTORY, so `cd /tmp && bun test <repo>/tests/x.test.ts` loads no preload at all: nothing
# is sandboxed, the guard stays disarmed, and every `getConfigDir()` in that process returns
# the developer's real `~/.opencodex`. On 2026-09-15 such a run deleted one. A test that needs
# a config directory pins its own OPENCODEX_HOME instead of trusting this line, and
# `tests/ci-workflows/test-home-guard.test.ts` enforces that for the destructive case.
preload = ["./tests/preload.ts"]