Repository navigation
Expand file tree
/
Copy pathbunfig.toml
More file actions
52 lines (52 loc) · 3.02 KB
/
Copy pathbunfig.toml
File metadata and controls
52 lines (52 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
[test]
preload = ["./tests/setup.ts"]
# TEMPORARY (mt#3561) — retirement tracked by mt#3575, escalate at 10 days.
#
# This was `true`, but it was a NO-OP on Bun 1.2.21: that version prints no seed
# and exposes neither `--seed` nor `--randomize`. The suite has been running in
# declaration order the whole time while declaring otherwise. Bun 1.3.14 honours
# the setting, which immediately surfaced ~9 clusters of order-dependent tests —
# tests leaning on a predecessor's side effects (shared fixtures mutated in
# sequence, module-globals reset only in `afterEach`, a spy leaked by reassigning
# the handle its `afterEach` restores).
#
# Setting it to `false` is therefore not a regression: it states honestly what
# has actually been happening for months, and unblocks the upgrade's real prizes
# (`bun test --changed`, and a ~40% faster suite). mt#3575 owns fixing the
# population and restoring `true` — with a CI seed sweep so the next
# order-dependence fails loudly instead of lying dormant.
#
# Do NOT treat this as licence to write order-dependent tests.
randomize = false
# CONCURRENCY (PR #3081 R1): the suite runs SERIALLY — files in order, tests
# within a file in order. Nothing here or in scripts/*.ts or package.json passes
# --concurrent, --parallel, --isolate or --shard, and the repo has zero
# test.concurrent / describe.concurrent call sites.
#
# Tests rely on that. A number of them mutate shared process state for the
# duration of a test body and restore it after — env vars in
# packages/domain/src/configuration/sources/environment.test.ts, module globals
# elsewhere. Serial execution is what makes that safe.
#
# Before enabling --concurrent (which interleaves test bodies inside ONE
# process, so those mutations become races), audit that population first.
# --parallel is the safer knob: per `bun test --help` it implies --isolate, so
# files get separate worker processes and separate environments.
# Standalone deployables under services/ are independent packages with their
# own node_modules and test commands. Exclude them from the main test runner
# so the repo-root `bun test` doesn't try to load their dependencies, which
# aren't installed in the repo-root node_modules. Each service has its own
# `bun test` command (see services/<name>/package.json).
#
# Cockpit web widget tests (src/cockpit/web/**) require a DOM environment
# (happy-dom) via tests/dom-setup.ts. They are excluded here and run via
# the dedicated `bun run test:components` script (mt#2152).
#
# NOTE (mt#2665): pathIgnorePatterns was tried as the exclusion mechanism for
# src/mcp/** (see below) but does NOT reliably prune a subdirectory when a
# CLI arg explicitly targets its parent (e.g. `bun test ./src` still recurses
# into src/mcp even with "src/mcp/**" listed here) -- confirmed empirically,
# several pattern variants tried. The src/mcp exclusion is instead done via
# explicit file enumeration in scripts/run-tests-main.ts (used by the "test"
# script below), which is unaffected by this limitation.
pathIgnorePatterns = ["services/**", "src/cockpit/web/**"]