@hughescr/stryker-bun-runner 1.4.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +600 -387
- package/dist/coverage/preload-logic.js +180 -7
- package/dist/index.d.ts +436 -71
- package/dist/index.js +1831 -7148
- package/dist/templates/coverage-preload.ts +59 -69
- package/package.json +17 -9
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
|
-
import { StrykerOptions } from '@stryker-mutator/api/core';
|
|
3
|
+
import { PartialStrykerOptions, StrykerOptions } from '@stryker-mutator/api/core';
|
|
4
4
|
import { Logger } from '@stryker-mutator/api/logging';
|
|
5
5
|
import { PluginKind } from '@stryker-mutator/api/plugin';
|
|
6
|
-
import { DryRunResult, MutantRunOptions, MutantRunResult, TestRunner, TestRunnerCapabilities } from '@stryker-mutator/api/test-runner';
|
|
6
|
+
import { DryRunOptions, DryRunResult, MutantRunOptions, MutantRunResult, TestRunner, TestRunnerCapabilities } from '@stryker-mutator/api/test-runner';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Bun test runner for Stryker mutation testing
|
|
@@ -18,13 +18,37 @@ export declare class BunTestRunner implements TestRunner {
|
|
|
18
18
|
private readonly timeout;
|
|
19
19
|
private readonly inspectorTimeout;
|
|
20
20
|
private readonly env?;
|
|
21
|
+
/** `bun.bunArgs` as the user wrote them; validated at init(). */
|
|
22
|
+
private readonly configuredBunArgs?;
|
|
23
|
+
/** `bun.bunArgs` as spawned: the user's `--config`/`-c` is removed (the runner passes its own sanitized one). */
|
|
21
24
|
private readonly bunArgs?;
|
|
25
|
+
/** {@link bunArgs} for mutant runs: without `--randomize`/`--seed`, which only the dry run keeps (see stripRandomizeArgs). */
|
|
26
|
+
private readonly mutantBunArgs?;
|
|
27
|
+
/**
|
|
28
|
+
* True when the current sanitized bunfig randomizes the test order, so mutant runs use its mutant-run
|
|
29
|
+
* copy (see mutantRunBunfigPath). Set whenever the sanitized bunfig is (re)generated, which every run does first.
|
|
30
|
+
*/
|
|
31
|
+
private sanitizedBunfigRandomizes?;
|
|
32
|
+
/** True once the "randomized order is off for mutant runs" debug line has been logged; it is shown once per runner. */
|
|
33
|
+
private loggedRandomizeOff;
|
|
34
|
+
/** Which argv-budget notes (see {@link fitTestFiles}) have been logged; each is shown once per runner. */
|
|
35
|
+
private readonly loggedFileArgNotes;
|
|
36
|
+
/**
|
|
37
|
+
* Each test file's dry-run duration in ms (project-relative file → sum of its tests' durations),
|
|
38
|
+
* from this worker's dry run or the shared registry. Mutant runs hand bun their files in
|
|
39
|
+
* ascending order of it; undefined when neither had any, and the order is then left alone.
|
|
40
|
+
*/
|
|
41
|
+
private testFileDurations?;
|
|
42
|
+
/** The user's bunfig named by `--config`/`-c` in `bun.bunArgs`, as written: the source the runner sanitizes and reads `[test].root` from. */
|
|
43
|
+
private readonly sourceBunfig?;
|
|
22
44
|
private readonly testFilesOverride?;
|
|
23
45
|
private readonly mutateGlobs;
|
|
24
46
|
private readonly smol;
|
|
25
47
|
private readonly maxChildRss?;
|
|
26
48
|
private readonly rssCheckIntervalMs?;
|
|
27
49
|
private readonly maxSpawnDepth?;
|
|
50
|
+
/** Stryker's coverageAnalysis from the Stryker options; DryRunOptions.coverageAnalysis wins when given. */
|
|
51
|
+
private readonly coverageAnalysis?;
|
|
28
52
|
private preloadScriptPath?;
|
|
29
53
|
private coverageFilePath?;
|
|
30
54
|
private sanitizedBunfigPath?;
|
|
@@ -33,16 +57,50 @@ export declare class BunTestRunner implements TestRunner {
|
|
|
33
57
|
private cachedTestNames?;
|
|
34
58
|
private baseNameIndex?;
|
|
35
59
|
private testNameIndex?;
|
|
60
|
+
/** The auto-discovered test files, valid for `cachedTestFilesCwd` only. Written by discovery alone, never by a selection. */
|
|
36
61
|
private cachedTestFiles?;
|
|
37
62
|
private cachedTestFilesCwd?;
|
|
63
|
+
/**
|
|
64
|
+
* The list mutantRun uses for its "run all tests" runs and for validating covering-test
|
|
65
|
+
* narrowing: the effective selection (Stryker's testFiles, bun.testFiles or discovery).
|
|
66
|
+
* Kept apart from {@link cachedTestFiles} so a selection can never be read back as the discovered set.
|
|
67
|
+
*/
|
|
68
|
+
private effectiveTestFiles?;
|
|
69
|
+
/**
|
|
70
|
+
* The test files Stryker's own `testFiles` option selected (DryRunOptions.testFiles), as
|
|
71
|
+
* exact absolute paths, valid for `cwd`. Set by dryRun (or loaded from the shared registry
|
|
72
|
+
* by a worker that never ran dryRun). While set it wins over bun.testFiles and
|
|
73
|
+
* auto-discovery, for the dry run and for every "run all tests" fallback after it.
|
|
74
|
+
*/
|
|
75
|
+
private strykerTestFiles?;
|
|
76
|
+
/** True once the "Stryker's testFiles overrides bun.testFiles" warning has been logged. */
|
|
77
|
+
private warnedTestFilesConflict;
|
|
78
|
+
/** True once the dist/build-discovery warning has been logged; it is shown once per runner. */
|
|
79
|
+
private warnedBuildOutputTests;
|
|
80
|
+
/** True once the "bunfig retry/rerunEach ignored" warning has been logged; it is shown once per runner. */
|
|
81
|
+
private warnedIgnoredBunfigKeys;
|
|
38
82
|
private cachedEagerModules?;
|
|
39
83
|
private cachedEagerModulesCwd?;
|
|
40
84
|
private lastRegistryTmpPath?;
|
|
85
|
+
/** True once `<bunPath> --version` has passed the startup check; later init() calls skip it. */
|
|
86
|
+
private bunChecked;
|
|
87
|
+
/** The version the startup check reported; set together with {@link bunChecked}. */
|
|
88
|
+
private bunVersion?;
|
|
89
|
+
/** True once the start summary has been logged; it is shown once per runner. */
|
|
90
|
+
private loggedStartSummary;
|
|
91
|
+
/** Stryker's `disableBail` option as given at construction; undefined when Stryker did not supply it. */
|
|
92
|
+
private readonly disableBail?;
|
|
93
|
+
/** Per-mutant warnings: the first of each kind at warn, the rest at debug, one summary per repeated kind at dispose(). */
|
|
94
|
+
private readonly mutantWarnings;
|
|
95
|
+
/** The mutant runs this worker has executed, by the status returned to Stryker. Reset when the end summary is logged. */
|
|
96
|
+
private mutantRunsByStatus;
|
|
97
|
+
/** Mutant runs that had covering tests but ran the full suite anyway (pattern too long, or zero-match retry). Reset with {@link mutantRunsByStatus}. */
|
|
98
|
+
private fullSuiteFallbacks;
|
|
41
99
|
/**
|
|
42
100
|
* AbortController for whichever `dryRun`/`mutantRun` child process is
|
|
43
101
|
* currently in flight, if any. Lets {@link dispose} kill an orphaned child
|
|
44
|
-
* if Stryker disposes this runner while a run hasn't finished — see
|
|
45
|
-
* "Orphan prevention".
|
|
102
|
+
* if Stryker disposes this runner while a run hasn't finished — see
|
|
103
|
+
* "Orphan prevention" in docs/internals.md.
|
|
46
104
|
*/
|
|
47
105
|
private currentAbortController?;
|
|
48
106
|
constructor(logger: Logger, options: StrykerOptions);
|
|
@@ -53,18 +111,24 @@ export declare class BunTestRunner implements TestRunner {
|
|
|
53
111
|
* cwd IS the user's real project root, and writing there would both
|
|
54
112
|
* pollute the user's project and never get cleaned up (dispose()
|
|
55
113
|
* deliberately never unlinks the registry itself — see its doc comment).
|
|
56
|
-
* The temp directory is OS-managed instead.
|
|
114
|
+
* The temp directory is OS-managed instead. Specifically it is the run's
|
|
115
|
+
* private directory (src/utils/private-temp-dir.ts): owned by the current
|
|
116
|
+
* user, mode 0700, re-resolved (and so re-verified) before every write and
|
|
117
|
+
* before the lazy load, so another local user can neither plant nor read a
|
|
118
|
+
* registry.
|
|
57
119
|
*
|
|
58
|
-
* Keyed by sha256(cwd + ':' + ppid): every worker process Stryker spawns
|
|
120
|
+
* Keyed by sha256(cwd + ':' + ppid) (plus the uid, in the directory name): every worker process Stryker spawns
|
|
59
121
|
* for one run is a direct child of that run's single Stryker main
|
|
60
122
|
* process, so all of them share BOTH process.cwd() (the sandbox
|
|
61
123
|
* directory) AND process.ppid (the main process's pid) — and therefore
|
|
62
|
-
* independently
|
|
124
|
+
* independently resolve this SAME path with no coordination required
|
|
125
|
+
* (resolveRunTempDir's numbered slots converge too: each call takes the
|
|
126
|
+
* lowest slot that is already ours). A
|
|
63
127
|
* worker recycled mid-run is still a child of the same main process, so
|
|
64
|
-
* it re-derives the same path too (
|
|
128
|
+
* it re-derives the same path too (docs/internals.md documents recycled instances
|
|
65
129
|
* lazily loading the registry). This is the entire sharing contract:
|
|
66
130
|
* writer (buildAndPersistTestRegistry) and reader (loadRegistryFile) both
|
|
67
|
-
* go through this one
|
|
131
|
+
* go through this one method rather than reimplementing the formula, so
|
|
68
132
|
* they can never disagree by construction.
|
|
69
133
|
*
|
|
70
134
|
* process.ppid is what makes this safe for this repo's own dogfooding:
|
|
@@ -85,13 +149,12 @@ export declare class BunTestRunner implements TestRunner {
|
|
|
85
149
|
* syscall (and a new ENOENT failure mode if the sandbox dir is mid-
|
|
86
150
|
* teardown) for no benefit.
|
|
87
151
|
*
|
|
88
|
-
*
|
|
152
|
+
* Reading process.cwd()/process.ppid at call time
|
|
89
153
|
* (rather than caching at construction) ensures the path resolves against
|
|
90
154
|
* Stryker's sandbox directory — which is set by the time these are
|
|
91
155
|
* invoked — rather than the orchestrator's cwd at module-load time.
|
|
92
156
|
*/
|
|
93
|
-
private
|
|
94
|
-
private get registryTmpPath();
|
|
157
|
+
private resolveRegistryPath;
|
|
95
158
|
/**
|
|
96
159
|
* Narrow a targeted mutant run to just the test FILES its covering tests live
|
|
97
160
|
* in.
|
|
@@ -118,18 +181,109 @@ export declare class BunTestRunner implements TestRunner {
|
|
|
118
181
|
*/
|
|
119
182
|
private resolveCoveringTestFiles;
|
|
120
183
|
/**
|
|
184
|
+
* `files` in ascending order of their dry-run duration, for a mutant run.
|
|
185
|
+
*
|
|
186
|
+
* Mutant runs bail on the first failing test, and bun runs the files it is given
|
|
187
|
+
* in argument order (measured on bun 1.4.2, for path arguments — see
|
|
188
|
+
* runBunTests). Running the cheapest covering file first means a fast unit test
|
|
189
|
+
* usually kills the mutant before a slow integration file is even loaded.
|
|
190
|
+
*
|
|
191
|
+
* The sort is stable: files that took the same time keep their order (the
|
|
192
|
+
* alphabetical order of the discovered list and of resolveCoveringTestFiles), and
|
|
193
|
+
* files with no recorded duration — every file, when there are no durations at
|
|
194
|
+
* all — go last in their old order. `files` itself is not modified.
|
|
195
|
+
*/
|
|
196
|
+
private orderCheapestFirst;
|
|
197
|
+
/**
|
|
198
|
+
* Say once, at debug, that mutant runs do not randomize the test order although
|
|
199
|
+
* the project asked for it (in the bunfig, in bun.bunArgs, or both). They run
|
|
200
|
+
* test files cheapest first and tests in source order, so a mutant's verdict
|
|
201
|
+
* never depends on a random order; the dry run keeps the setting.
|
|
202
|
+
*/
|
|
203
|
+
private logRandomizeOffOnce;
|
|
204
|
+
/**
|
|
121
205
|
* Get test runner capabilities
|
|
122
206
|
*/
|
|
123
207
|
capabilities(): TestRunnerCapabilities;
|
|
124
208
|
/**
|
|
209
|
+
* The files Stryker's own `testFiles` option selected, when they apply to `cwd`.
|
|
210
|
+
* A selection recorded under another cwd (a different sandbox) names files that
|
|
211
|
+
* are not there, so it is ignored rather than trusted.
|
|
212
|
+
*/
|
|
213
|
+
private selectedTestFilesFor;
|
|
214
|
+
/**
|
|
215
|
+
* Record (or clear) the selection from DryRunOptions.testFiles for this dry run.
|
|
216
|
+
*
|
|
217
|
+
* Stryker (core 9.6+, also 10) fills `testFiles` with the sandbox-absolute paths of
|
|
218
|
+
* the files matching its `testFiles` option, or leaves it undefined. Only a
|
|
219
|
+
* non-empty array counts; an empty one is treated as unset. Relative entries are
|
|
220
|
+
* resolved against the cwd, so bun gets exact paths (a bare relative argument is a
|
|
221
|
+
* substring filter to `bun test`, which would also run e.g. a `dist/` copy).
|
|
222
|
+
*
|
|
223
|
+
* Precedence for the files bun is handed: Stryker's testFiles > bun.testFiles >
|
|
224
|
+
* auto-discovery. When both Stryker's and bun.testFiles select files and they
|
|
225
|
+
* differ, one warning says Stryker's wins.
|
|
226
|
+
*/
|
|
227
|
+
private applyDryRunTestFiles;
|
|
228
|
+
/** Where the test files for `cwd` come from, in the precedence of {@link getOrDiscoverTestFiles}, for the log. */
|
|
229
|
+
private testFilesSource;
|
|
230
|
+
/** Like {@link testFilesSource}, but undefined when the files are auto-discovered rather than chosen by the user. */
|
|
231
|
+
private explicitTestFilesSource;
|
|
232
|
+
/**
|
|
233
|
+
* The test files to hand bun for this spawn, kept within the argv budget (see
|
|
234
|
+
* MAX_TEST_FILE_ARGS_BYTES). `files` is already narrowed and ordered.
|
|
235
|
+
*
|
|
236
|
+
* - Within the budget (as absolute paths, or as the shorter ./-relative ones
|
|
237
|
+
* runBunTests then picks, said once at debug): `files` as given.
|
|
238
|
+
* - Over it, with auto-discovered files: undefined, so bun finds and runs every
|
|
239
|
+
* test file itself. That is the full suite, which is what a full-suite run
|
|
240
|
+
* lists anyway, and a superset of a targeted run's covering files — safe,
|
|
241
|
+
* because a targeted run keeps its --test-name-pattern; it only loses the
|
|
242
|
+
* cheapest-first order (said once at info).
|
|
243
|
+
* - Over it, with files the user chose (bun.testFiles, Stryker's testFiles):
|
|
244
|
+
* `files`, as no other list would keep the selection, and a warning (once)
|
|
245
|
+
* that bun may fail to start.
|
|
246
|
+
*
|
|
247
|
+
* @param explicitSource - What chose the files, or undefined when they were auto-discovered
|
|
248
|
+
*/
|
|
249
|
+
private fitTestFiles;
|
|
250
|
+
/** Debug-log how many test files the dry run uses and where they came from. Same precedence as {@link getOrDiscoverTestFiles}. */
|
|
251
|
+
private logTestFilesSource;
|
|
252
|
+
/**
|
|
253
|
+
* Log the one-line start summary (at debug, once per runner): the bun version and path, how
|
|
254
|
+
* many test files the runner hands bun and where they came from, the sanitized bunfig, and
|
|
255
|
+
* whether mutant runs bail. Called at the end of init(), so a re-init in another cwd
|
|
256
|
+
* (Stryker's sandbox rotation) does not repeat it. It is debug, not info, because every
|
|
257
|
+
* Stryker worker process logs its own copy, which at high concurrency reads like many dry runs.
|
|
258
|
+
*
|
|
259
|
+
* @param testFiles the files {@link getOrDiscoverTestFiles} chose; undefined when discovery
|
|
260
|
+
* found none and bun is left to discover the tests itself
|
|
261
|
+
*/
|
|
262
|
+
private logStartSummary;
|
|
263
|
+
/**
|
|
264
|
+
* Warn, once per runner, that Stryker's testFiles option replaces a differing
|
|
265
|
+
* bun.testFiles. Both are compared as sets of resolved absolute paths, so the same
|
|
266
|
+
* files spelled relative vs absolute, or in another order, are not a conflict.
|
|
267
|
+
*/
|
|
268
|
+
private warnIfTestFilesOverridden;
|
|
269
|
+
/**
|
|
125
270
|
* Return the test file list to use for this run.
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
* the first
|
|
271
|
+
* Precedence: the files Stryker's own `testFiles` option selected (see
|
|
272
|
+
* {@link applyDryRunTestFiles}), then `bun.testFiles` (returned verbatim), then
|
|
273
|
+
* auto-discovery; the first two skip discovery entirely. A discovery result is
|
|
274
|
+
* cached after the first real call so that subsequent callers (dryRun, mutantRun)
|
|
129
275
|
* do not re-glob the filesystem.
|
|
130
276
|
*/
|
|
131
277
|
private getOrDiscoverTestFiles;
|
|
132
278
|
/**
|
|
279
|
+
* Warn, once per runner, when auto-discovery picked up test files below a
|
|
280
|
+
* `dist` or `build` directory. Bun searches those directories too, so a
|
|
281
|
+
* project whose tsc emits `dist/**\/*.test.js` gets the compiled copies run
|
|
282
|
+
* as well: slower, and a stale compiled test can fail the dry run. Parity
|
|
283
|
+
* with `bun test` is kept on purpose; the warning names the ways out.
|
|
284
|
+
*/
|
|
285
|
+
private warnAboutBuildOutputTests;
|
|
286
|
+
/**
|
|
133
287
|
* Test-file cache hit for a given cwd.
|
|
134
288
|
* Returns the cached list synchronously when available, or undefined to
|
|
135
289
|
* signal that async re-discovery is needed (cwd changed or first call).
|
|
@@ -140,11 +294,21 @@ export declare class BunTestRunner implements TestRunner {
|
|
|
140
294
|
* Initialize the test runner
|
|
141
295
|
*/
|
|
142
296
|
init(): Promise<void>;
|
|
297
|
+
/** Create/verify the run's private temp directory (see src/utils/private-temp-dir.ts) and remember it as this worker's tempDir. */
|
|
298
|
+
private ensureRunTempDir;
|
|
299
|
+
/**
|
|
300
|
+
* Log the bunfig settings the sanitizer dropped or overrode: each at debug with
|
|
301
|
+
* its reason, and the ones mutation runs cannot honour (retry, rerunEach) in
|
|
302
|
+
* one warning, shown once per runner however often the bunfig is regenerated.
|
|
303
|
+
*/
|
|
304
|
+
private reportDroppedBunfigKeys;
|
|
143
305
|
/**
|
|
144
306
|
* Regenerate the sanitized bunfig if the worker's cwd has changed (or if this
|
|
145
|
-
* is the first spawn).
|
|
146
|
-
*
|
|
147
|
-
* the
|
|
307
|
+
* is the first spawn). The sanitizer anchors the relative `preload`/`root`
|
|
308
|
+
* paths it forwards at this cwd (bun itself resolves relative bunfig paths
|
|
309
|
+
* against the process cwd, not against the bunfig's directory), so keying on
|
|
310
|
+
* cwd ensures those paths land in the right sandbox. Every setting it did not
|
|
311
|
+
* forward is logged at debug; ignored retry/rerun settings warn once per runner.
|
|
148
312
|
*/
|
|
149
313
|
private ensureSanitizedBunfig;
|
|
150
314
|
/**
|
|
@@ -158,6 +322,11 @@ export declare class BunTestRunner implements TestRunner {
|
|
|
158
322
|
* whole file (never a half-initialised registry). Failures are non-fatal — the
|
|
159
323
|
* worker falls back to raw console names and the lossy pattern reconstruction,
|
|
160
324
|
* and a warning is logged so the issue is visible.
|
|
325
|
+
*
|
|
326
|
+
* The registry is only ever read from a verified private directory: it is
|
|
327
|
+
* resolved first, outside the try, so a registry another user could have
|
|
328
|
+
* planted is never trusted, and an unsafe temp area (a directory above the
|
|
329
|
+
* run directory) fails the mutant run loudly instead.
|
|
161
330
|
*/
|
|
162
331
|
private loadRegistryFile;
|
|
163
332
|
/**
|
|
@@ -193,9 +362,24 @@ export declare class BunTestRunner implements TestRunner {
|
|
|
193
362
|
*/
|
|
194
363
|
private buildTestsFromInspector;
|
|
195
364
|
/**
|
|
196
|
-
* Run all tests (dry run)
|
|
365
|
+
* Run all tests (dry run). Stryker always passes `options`; only its
|
|
366
|
+
* `coverageAnalysis` is read (to judge missing coverage, see
|
|
367
|
+
* checkCoverageData), falling back to the Stryker options' value. bun.timeout,
|
|
368
|
+
* not `options.timeout` (dryRunTimeoutMinutes), bounds the child.
|
|
369
|
+
*/
|
|
370
|
+
dryRun(options?: DryRunOptions): Promise<DryRunResult>;
|
|
371
|
+
/**
|
|
372
|
+
* The dry run's coverageAnalysis: Stryker's DryRunOptions value, else the
|
|
373
|
+
* Stryker options' value. Extracted to keep dryRun()'s complexity under the
|
|
374
|
+
* lint threshold.
|
|
197
375
|
*/
|
|
198
|
-
|
|
376
|
+
private resolveCoverageAnalysis;
|
|
377
|
+
/**
|
|
378
|
+
* Emit the single post-drain `warn` iff {@link collectAbnormalDrainProblems}
|
|
379
|
+
* finds anything; a healthy dry run logs nothing at warn. Extracted from
|
|
380
|
+
* dryRun() to keep its complexity under the lint threshold.
|
|
381
|
+
*/
|
|
382
|
+
private warnOnAbnormalDrainData;
|
|
199
383
|
/**
|
|
200
384
|
* Post-child-exit dry-run pipeline: collect/remap coverage, build tests
|
|
201
385
|
* from inspector data, sort them for incremental-mode determinism, run the
|
|
@@ -209,6 +393,43 @@ export declare class BunTestRunner implements TestRunner {
|
|
|
209
393
|
*/
|
|
210
394
|
private buildGatedDryRunResult;
|
|
211
395
|
/**
|
|
396
|
+
* Judge the dry run's mutant coverage before it is handed to Stryker.
|
|
397
|
+
*
|
|
398
|
+
* Stryker treats `mutantCoverage: undefined` as "no coverage analysis": every
|
|
399
|
+
* mutant then runs the FULL suite (mutant-test-planner's no-coverage branch),
|
|
400
|
+
* with no message saying why. The coverage preload writes the coverage file in
|
|
401
|
+
* its final afterAll on every dry run — even one that covered nothing writes a
|
|
402
|
+
* line with empty perTest/static — so a dry run that completed without one
|
|
403
|
+
* means the preload never ran, could not write (it logs a `[Stryker Coverage]`
|
|
404
|
+
* line on the child's stderr), or the child exited before that afterAll.
|
|
405
|
+
*
|
|
406
|
+
* - coverageAnalysis 'perTest': the user asked for per-test coverage, and
|
|
407
|
+
* silently running the full suite per mutant can turn a run of minutes into
|
|
408
|
+
* hours — fail the dry run (Error), naming the file and likely causes.
|
|
409
|
+
* 'all'/'off' remain available to run without it.
|
|
410
|
+
* - 'all' (or unknown): warn with the same explanation; the run is correct, only slower.
|
|
411
|
+
* - 'off': Stryker wants no coverage; say nothing.
|
|
412
|
+
* A dry run with failed tests is left alone: Stryker stops on those anyway,
|
|
413
|
+
* and its failed-test report is the more useful message.
|
|
414
|
+
*
|
|
415
|
+
* When coverage exists but covers no mutant at all, every mutant will be
|
|
416
|
+
* NoCoverage (Stryker's executeNoCoverage) — warn, since that is a legitimate
|
|
417
|
+
* outcome only when the tests really never touch the mutated files.
|
|
418
|
+
*
|
|
419
|
+
* `[Stryker Coverage]` diagnostics from the preload are otherwise dropped on a
|
|
420
|
+
* green run (the child's stderr is only shown on failure), so they are
|
|
421
|
+
* surfaced at warn here, or folded into the missing-coverage message.
|
|
422
|
+
*/
|
|
423
|
+
private checkCoverageData;
|
|
424
|
+
/**
|
|
425
|
+
* Warn when a completed dry run used more than {@link DRY_RUN_TIMEOUT_WARN_RATIO}
|
|
426
|
+
* of bun.timeout. bun.timeout now governs only the dry run (mutant runs follow
|
|
427
|
+
* Stryker's per-mutant timeout), so this is the one place a too-small value
|
|
428
|
+
* bites: the next, slightly slower dry run is killed. Called once, from the
|
|
429
|
+
* Complete path of the single dry run.
|
|
430
|
+
*/
|
|
431
|
+
private warnOnTightDryRunTimeout;
|
|
432
|
+
/**
|
|
212
433
|
* Build the in-memory test name cache and base-name index, then atomically
|
|
213
434
|
* persist them — together with the exact-name testNameIndex from
|
|
214
435
|
* buildTestsFromInspector — to a well-known file so other worker processes
|
|
@@ -220,6 +441,12 @@ export declare class BunTestRunner implements TestRunner {
|
|
|
220
441
|
*/
|
|
221
442
|
private buildAndPersistTestRegistry;
|
|
222
443
|
/**
|
|
444
|
+
* Warn that the dry-run registry could not be written. The registry also carries
|
|
445
|
+
* Stryker's testFiles selection, so when one is active the warning adds that other
|
|
446
|
+
* workers will not see it and fall back to bun.testFiles or auto-discovery.
|
|
447
|
+
*/
|
|
448
|
+
private warnRegistryWriteFailed;
|
|
449
|
+
/**
|
|
223
450
|
* Lossy-visibility warns for a mutant run's --test-name-pattern.
|
|
224
451
|
*
|
|
225
452
|
* Bun exits 0 on a PARTIAL pattern miss (verified live, bun 1.3.14),
|
|
@@ -234,6 +461,28 @@ export declare class BunTestRunner implements TestRunner {
|
|
|
234
461
|
*/
|
|
235
462
|
mutantRun(options: MutantRunOptions): Promise<MutantRunResult>;
|
|
236
463
|
/**
|
|
464
|
+
* Recognise a testFilter that is a list of test FILES rather than test ids.
|
|
465
|
+
*
|
|
466
|
+
* Stryker core's own `testFiles` option (9.6+, also 10) makes the mutant
|
|
467
|
+
* planner give static and no-coverage mutants `testFilter =
|
|
468
|
+
* project.testFiles.map(sandbox.sandboxFileFor)` — absolute paths of test files
|
|
469
|
+
* inside the sandbox (mutant-test-planner.js, verified on 10.0.0) — instead of
|
|
470
|
+
* undefined. Treated as ids they build a --test-name-pattern that matches
|
|
471
|
+
* nothing, forcing a full-suite retry whose deadline kill is then (wrongly)
|
|
472
|
+
* scored as an inconclusive Error. They are the opposite of covering tests:
|
|
473
|
+
* Stryker sized the timeout for exactly these files, so they run as given.
|
|
474
|
+
*
|
|
475
|
+
* Every entry must pass all of: not a known test id (the dry-run registry
|
|
476
|
+
* wins), ends in a test-file suffix, and names an existing regular file
|
|
477
|
+
* (resolved against the cwd when relative). One failing entry — or an empty
|
|
478
|
+
* filter — means this is an ordinary id filter and the answer is undefined.
|
|
479
|
+
* The checks are ordered so a normal id filter costs no I/O.
|
|
480
|
+
*
|
|
481
|
+
* @returns The distinct files, sorted, as Stryker gave them; undefined when
|
|
482
|
+
* the filter is not a file list
|
|
483
|
+
*/
|
|
484
|
+
private resolveTestFileFilter;
|
|
485
|
+
/**
|
|
237
486
|
* Spawn bun for a mutant run and interpret the result. Extracted from
|
|
238
487
|
* mutantRun so that a --test-name-pattern which matched 0 tests can retry
|
|
239
488
|
* once with the full suite (testNamePattern undefined) while reusing the
|
|
@@ -241,19 +490,76 @@ export declare class BunTestRunner implements TestRunner {
|
|
|
241
490
|
* killedBy resolution — avoiding both a false Killed and redundant setup.
|
|
242
491
|
* The retry always recurses with testNamePattern undefined, so the retry
|
|
243
492
|
* gate's first conjunct is false on that call: recursion is bounded to
|
|
244
|
-
* depth 1 by construction, never a retry-of-a-retry.
|
|
493
|
+
* depth 1 by construction, never a retry-of-a-retry. The retry spends what is
|
|
494
|
+
* left of the same deadline, because Stryker's timer covers both spawns.
|
|
245
495
|
*/
|
|
246
496
|
private executeMutantRun;
|
|
247
497
|
/**
|
|
498
|
+
* Count a spawn that had covering tests but no pattern: it runs the whole suite instead of
|
|
499
|
+
* just those tests, because the pattern was too long for argv or because this is the retry
|
|
500
|
+
* of a zero-match pattern. A mutant gets at most one such spawn (the retry never retries),
|
|
501
|
+
* so this counts mutants.
|
|
502
|
+
*/
|
|
503
|
+
private countFullSuiteFallback;
|
|
504
|
+
/**
|
|
505
|
+
* The verdict for a mutant run that ran away — it exceeded Stryker's hit limit,
|
|
506
|
+
* or the runner had to kill it — or undefined for a run that ended on its own.
|
|
507
|
+
*/
|
|
508
|
+
private classifyRunawayMutantRun;
|
|
509
|
+
/**
|
|
510
|
+
* Error result for a full-suite fallback run killed at the limit derived from
|
|
511
|
+
* Stryker's per-mutant timeout — see classifyRunawayMutantRun.
|
|
512
|
+
*/
|
|
513
|
+
private buildInconclusiveFallbackTimeout;
|
|
514
|
+
/**
|
|
248
515
|
* Build the MutantRunResult for a killed mutant (non-zero exit code).
|
|
249
516
|
* Handles runtime error detection and killedBy resolution.
|
|
250
517
|
*/
|
|
251
518
|
private buildMutantKilledResult;
|
|
252
519
|
/**
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
|
|
256
|
-
|
|
520
|
+
* Error result for a mutant run whose `bun test` child died from a signal
|
|
521
|
+
* without attributable failing-test evidence — see buildMutantKilledResult.
|
|
522
|
+
* Logged at warn (with the output head, like the unattributable-kill path) so
|
|
523
|
+
* a crashing suite is visible rather than silently scored.
|
|
524
|
+
*/
|
|
525
|
+
private buildSignalErrorResult;
|
|
526
|
+
/**
|
|
527
|
+
* Classify a non-zero, non-signal, non-timeout mutant run in which no
|
|
528
|
+
* individual test reported a failure. Returns an Error result when there is
|
|
529
|
+
* no evidence the mutant was detected, or null to let the caller score it
|
|
530
|
+
* Killed (with an empty killedBy, since no single test failed).
|
|
531
|
+
*
|
|
532
|
+
* Killed needs evidence that the suite failed, and bun's summary is that
|
|
533
|
+
* evidence: a non-zero ' N fail' (or 'Bailed out after N failures') or
|
|
534
|
+
* ' N error' count. That is exactly what bun prints when a test file cannot
|
|
535
|
+
* load — its import graph throws (TypeError, ReferenceError, …), a source or
|
|
536
|
+
* test file no longer parses, a describe body throws — as an "# Unhandled
|
|
537
|
+
* error between tests" block with no `(fail)` line. Verified on bun 1.4.2: a
|
|
538
|
+
* source module that throws at import gives ' 1 fail' + ' 1 error'; a
|
|
539
|
+
* describe body that throws gives ' 0 fail' + ' 1 error'; under --bail both
|
|
540
|
+
* the throwing import and a source syntax error give 'Bailed out after 1
|
|
541
|
+
* failure'. Stryker's jest and vitest runners score a test file that fails to
|
|
542
|
+
* load as Killed too, and a whole class of mutants (module-level constants,
|
|
543
|
+
* config objects) can only ever be detected this way.
|
|
544
|
+
*
|
|
545
|
+
* Why that is not a false Killed: a load failure in a test FILE and one in a
|
|
546
|
+
* SOURCE file print the same shape, but under mutation only source files are
|
|
547
|
+
* changed, and the dry run — which must pass, and which fails outright on any
|
|
548
|
+
* unattributable fail/error count (see checkDryRunProcessResult and the
|
|
549
|
+
* completeness gate's Signal C) — loaded every one of these files without
|
|
550
|
+
* error. So a load failure seen here was caused by the active mutant. The
|
|
551
|
+
* residual risk is a load failure that depends on which files run together:
|
|
552
|
+
* a targeted run hands bun only the covering tests' files, so a test file
|
|
553
|
+
* that only loads after some other file has run would fail here and not in
|
|
554
|
+
* the dry run. That is a test-isolation defect the same way it is under jest.
|
|
555
|
+
*
|
|
556
|
+
* Error remains for the cases that are no evidence at all: bun's zero-match
|
|
557
|
+
* --test-name-pattern error (a runner pattern gap, not a kill), and a run
|
|
558
|
+
* whose output carries no failure count whatsoever (a missing preload, an
|
|
559
|
+
* unparseable bunfig, a crash that printed no summary). An exit code alone is
|
|
560
|
+
* not evidence that a test caught the mutant.
|
|
561
|
+
*/
|
|
562
|
+
private classifyRunWithoutFailedTest;
|
|
257
563
|
/**
|
|
258
564
|
* Check for dry run process failures (timeout or non-zero exit).
|
|
259
565
|
* Returns a DryRunResult to short-circuit if the process failed, or null to proceed.
|
|
@@ -275,8 +581,8 @@ export declare class BunTestRunner implements TestRunner {
|
|
|
275
581
|
*/
|
|
276
582
|
private formatInspectorFailureDetails;
|
|
277
583
|
/**
|
|
278
|
-
* Diagnostic-only check for the Complete dry-run path: bun
|
|
279
|
-
* (non-zero exit
|
|
584
|
+
* Diagnostic-only check for the Complete dry-run path: bun's console recap
|
|
585
|
+
* reported a failed count (a non-zero exit always comes with one by this point) but nothing in the
|
|
280
586
|
* built test results identifies which test failed. This is the observed
|
|
281
587
|
* incident fingerprint — bun prints e.g. "1 tests failed:" with an empty
|
|
282
588
|
* recap, the inspector shows no TestStatus.Failed entry, and nothing points
|
|
@@ -291,44 +597,28 @@ export declare class BunTestRunner implements TestRunner {
|
|
|
291
597
|
/**
|
|
292
598
|
* Dry-run data-completeness gate.
|
|
293
599
|
*
|
|
294
|
-
*
|
|
295
|
-
*
|
|
296
|
-
*
|
|
297
|
-
*
|
|
298
|
-
*
|
|
299
|
-
*
|
|
600
|
+
* A dry run may only be reported Complete when every test bun ran, and every
|
|
601
|
+
* per-test coverage key the preload recorded, is accounted for: bun's console
|
|
602
|
+
* summary, the inspector's TestReporter events and the coverage keys must
|
|
603
|
+
* agree EXACTLY (see src/dry-run-completeness.ts for each comparison and the
|
|
604
|
+
* bun behaviour it accounts for). Any unexplained difference fails the dry
|
|
605
|
+
* run (DryRunStatus.Error) with a message naming what was lost, the counts
|
|
606
|
+
* and the likely cause: a Complete run built on lost or merged data would
|
|
607
|
+
* hand Stryker coverage that is silently missing or credited to the wrong
|
|
608
|
+
* tests, and loud failure is preferred to that.
|
|
300
609
|
*
|
|
301
610
|
* ONLY evaluated when the run otherwise looks GREEN (zero Failed entries in
|
|
302
611
|
* the already-built `tests`): an already-failing dry run is handled by
|
|
303
612
|
* {@link checkDryRunProcessResult} / {@link warnOnUnidentifiedDryRunFailure},
|
|
304
|
-
* and
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
313
|
-
* ParsedTestResults.summaryPassed/summaryFailed) compared against the
|
|
314
|
-
* count of ids in `executionOrder` whose status is neither 'skip' nor
|
|
315
|
-
* bun's not-yet-implemented placeholder-test status. Retries do not
|
|
316
|
-
* create a shortfall in this direction: empirically (bun 1.3.14), a
|
|
317
|
-
* retried test fires ONE TestReporter.start per ATTEMPT for the SAME
|
|
318
|
-
* inspector id — so executionOrder, if anything, grows on retries, and
|
|
319
|
-
* bun's summary line counts tests, not attempts, either way. A material
|
|
320
|
-
* shortfall must clear both an absolute floor and a ratio floor.
|
|
321
|
-
*
|
|
322
|
-
* - Signal B (orphaned coverage keys): `orphanedKeyCount` (a whole file's
|
|
323
|
-
* coverage keys unpaired with any inspector test — see coverage-mapper.ts)
|
|
324
|
-
* exceeding a small absolute floor. Deliberately gate-blind for the legacy
|
|
325
|
-
* ("test-N") coverage format, which never populates this count — Signal A
|
|
326
|
-
* still covers that path since it does not depend on coverage format.
|
|
327
|
-
*
|
|
328
|
-
* `wasClosedUnexpectedly` is NEVER a standalone trigger — the WS-vs-child-exit
|
|
329
|
-
* close race can plausibly be true on a nontrivial fraction of healthy runs —
|
|
330
|
-
* it is folded into the Error message only as corroborating context once the
|
|
331
|
-
* gate has already fired via Signal A or B.
|
|
613
|
+
* and Stryker stops on its failed tests anyway. That also keeps out hook
|
|
614
|
+
* failures, which bun counts as failures with no inspector events.
|
|
615
|
+
*
|
|
616
|
+
* Besides the data-loss checks, it fails when bun's summary counts failing
|
|
617
|
+
* tests but none of them could be attributed to a test (Signal C, below).
|
|
618
|
+
*
|
|
619
|
+
* `wasClosedUnexpectedly` is NEVER a trigger: bun closes the inspector socket
|
|
620
|
+
* a few ms after the drain acknowledgment on healthy runs. It is added to the
|
|
621
|
+
* message only as context once the gate has already fired.
|
|
332
622
|
*
|
|
333
623
|
* @returns A DryRunStatus.Error result if the gate fires, otherwise null.
|
|
334
624
|
*/
|
|
@@ -408,10 +698,66 @@ export declare class BunTestRunner implements TestRunner {
|
|
|
408
698
|
*/
|
|
409
699
|
private warnUnresolvedKilledBy;
|
|
410
700
|
/**
|
|
701
|
+
* Log the one-line end summary (at info): this worker's mutant runs by outcome and how many
|
|
702
|
+
* of them ran the full suite as a fallback. Nothing is logged for a worker that ran no
|
|
703
|
+
* mutant, and the tallies restart afterwards so a second dispose() does not repeat the line.
|
|
704
|
+
*/
|
|
705
|
+
private logMutantRunSummary;
|
|
706
|
+
/**
|
|
411
707
|
* Cleanup resources
|
|
708
|
+
*
|
|
709
|
+
* Removes only this worker's own files. The registry, and so the run's private
|
|
710
|
+
* temp directory holding it, is deliberately left in place: Stryker gives a
|
|
711
|
+
* worker no signal that it is the last one, and maxTestRunnerReuse /
|
|
712
|
+
* crash recovery dispose a worker mid-run and start a fresh process that must
|
|
713
|
+
* still find the registry (with concurrency 1, the disposing worker IS the
|
|
714
|
+
* only one, so a "last one out" check would delete it from under its successor).
|
|
412
715
|
*/
|
|
413
716
|
dispose(): Promise<void>;
|
|
414
717
|
}
|
|
718
|
+
/** Options for {@link withTestFilesExcludedFromTypeCheck}. */
|
|
719
|
+
export interface TestFilesExcludedFromTypeCheckOptions {
|
|
720
|
+
/** The project directory Stryker runs in (default: `process.cwd()`). */
|
|
721
|
+
cwd?: string;
|
|
722
|
+
}
|
|
723
|
+
/**
|
|
724
|
+
* Point @stryker-mutator/typescript-checker at a copy of the project's tsconfig
|
|
725
|
+
* without the tests, so mutants are type-checked against the code under test only.
|
|
726
|
+
*
|
|
727
|
+
* Reads the config's `tsconfigFile` (default `tsconfig.json`) with the
|
|
728
|
+
* project's own TypeScript and writes `<name>.stryker-checker.json` next to it.
|
|
729
|
+
* That file extends the original and lists as `files` every file of the project
|
|
730
|
+
* except:
|
|
731
|
+
* - test files, by this runner's rules: Bun's naming rules under bunfig's
|
|
732
|
+
* `[test].root`, `bun.testFiles` and Stryker's `testFiles` patterns;
|
|
733
|
+
* - bunfig `[test].preload` scripts;
|
|
734
|
+
* - files that only those (and each other) import, such as test helpers,
|
|
735
|
+
* unless a `mutate` pattern covers them or they shape the types of other
|
|
736
|
+
* files (a global script, or a `declare global` / `declare module "x"`
|
|
737
|
+
* augmentation).
|
|
738
|
+
*
|
|
739
|
+
* A file the remaining code imports still comes in through that import, so the
|
|
740
|
+
* program always compiles as before. Before anything is written the derived
|
|
741
|
+
* program is type-checked once, and the derived file is not used if that finds
|
|
742
|
+
* an error in non-test code that the original program does not have. Returns a
|
|
743
|
+
* copy of `config` with `tsconfigFile` set to the derived file and, when
|
|
744
|
+
* `ignorePatterns` is set, a negation for it appended, so Stryker's sandbox
|
|
745
|
+
* gets it too (Stryker rewrites the `tsconfigFile` chain's paths there).
|
|
746
|
+
*
|
|
747
|
+
* Logs one line per call: `console.info` on success, `console.warn` with the
|
|
748
|
+
* reason on every fallback. Returns `config` itself, writing nothing, when
|
|
749
|
+
* `checkers` does not include `typescript`, typescript cannot be loaded from
|
|
750
|
+
* `cwd`, the tsconfig is missing, has errors or uses project references,
|
|
751
|
+
* includes no test files, would be left with no files at all, leaving the tests
|
|
752
|
+
* out adds type errors, or the derived file cannot be written or belongs to
|
|
753
|
+
* somebody else (it has no generated header).
|
|
754
|
+
*
|
|
755
|
+
* @example
|
|
756
|
+
* // stryker.conf.mjs
|
|
757
|
+
* import { withTestFilesExcludedFromTypeCheck } from '@hughescr/stryker-bun-runner';
|
|
758
|
+
* export default await withTestFilesExcludedFromTypeCheck({ testRunner: 'bun', checkers: ['typescript'] });
|
|
759
|
+
*/
|
|
760
|
+
export declare function withTestFilesExcludedFromTypeCheck<T extends PartialStrykerOptions>(config: T, { cwd }?: TestFilesExcludedFromTypeCheckOptions): Promise<T & PartialStrykerOptions>;
|
|
415
761
|
/**
|
|
416
762
|
* Configuration options specific to the Bun test runner
|
|
417
763
|
*/
|
|
@@ -422,8 +768,11 @@ export interface BunTestRunnerOptions {
|
|
|
422
768
|
*/
|
|
423
769
|
bunPath?: string;
|
|
424
770
|
/**
|
|
425
|
-
*
|
|
426
|
-
*
|
|
771
|
+
* Dry-run child-process timeout in milliseconds — the maximum wall-clock time
|
|
772
|
+
* the dry run's `bun test` subprocess may run (plus a fixed 30 s allowance for
|
|
773
|
+
* the coverage drain handshake) before it is killed. Mutant runs follow
|
|
774
|
+
* Stryker's per-mutant `MutantRunOptions.timeout` instead, and fall back to
|
|
775
|
+
* this value only when Stryker supplies none.
|
|
427
776
|
* @default 10000
|
|
428
777
|
*
|
|
429
778
|
* Note: this is distinct from Bun's per-test timeout configured via
|
|
@@ -449,14 +798,30 @@ export interface BunTestRunnerOptions {
|
|
|
449
798
|
* Stryker's `disableBail` option, so a bail flag configured here would
|
|
450
799
|
* otherwise silently override that decision.
|
|
451
800
|
*
|
|
801
|
+
* Flags that would break per-test coverage attribution or the runner's own
|
|
802
|
+
* test selection (`--concurrent`, `--max-concurrency`, `--parallel`,
|
|
803
|
+
* `--test-worker`, `--shard`, `--changed`, `-t`/`--test-name-pattern`,
|
|
804
|
+
* `-u`/`--update-snapshots`, `--pass-with-no-tests`, `--watch`,
|
|
805
|
+
* `--coverage`, `--coverage-reporter`, `--coverage-dir`, `--cwd`,
|
|
806
|
+
* `--inspect`, `--inspect-wait`, `--inspect-brk`), and the flags that re-run
|
|
807
|
+
* tests (`--retry`, `--rerun-each`), make `init()` throw instead of being
|
|
808
|
+
* passed through — see src/utils/bun-args.ts.
|
|
809
|
+
*
|
|
810
|
+
* `--randomize` and `--seed` apply to the dry run only: mutant runs drop them.
|
|
811
|
+
*
|
|
812
|
+
* `--config=<path>` (or `--config <path>` / `-c <path>`) names the bunfig the
|
|
813
|
+
* runner sanitizes and reads `[test].root` from, resolved against the project
|
|
814
|
+
* directory. It is removed from the bun command line, because the runner
|
|
815
|
+
* always passes bun its own sanitized `--config`. Without a path it throws.
|
|
816
|
+
*
|
|
452
817
|
* @example ['--only', '--verbose']
|
|
453
818
|
*/
|
|
454
819
|
bunArgs?: string[];
|
|
455
820
|
/**
|
|
456
821
|
* Explicit list of test file paths (must be non-empty when provided).
|
|
457
|
-
* When provided, BunTestRunner skips auto-discovery (which
|
|
458
|
-
*
|
|
459
|
-
* list. Useful for restricting mutation testing to a subset, or for callers
|
|
822
|
+
* When provided, BunTestRunner skips auto-discovery (which walks the project
|
|
823
|
+
* the way `bun test` does — `.test`/`_test`/`.spec`/`_spec` files, starting at
|
|
824
|
+
* `[test].root` from bunfig.toml when set) and uses exactly this list. Useful for restricting mutation testing to a subset, or for callers
|
|
460
825
|
* that run outside Stryker's sandboxed cwd and need to point at a specific
|
|
461
826
|
* file set. Relative paths resolve against the bun subprocess's cwd.
|
|
462
827
|
*
|
|
@@ -477,17 +842,17 @@ export interface BunTestRunnerOptions {
|
|
|
477
842
|
* memory-constrained machines, especially at higher Stryker `concurrency`,
|
|
478
843
|
* since peak memory during a campaign is roughly
|
|
479
844
|
* `concurrency × per-run suite footprint` (each run is an isolated process
|
|
480
|
-
* that exits when it completes — see
|
|
845
|
+
* that exits when it completes — see "Memory model" in docs/internals.md).
|
|
481
846
|
* @default false
|
|
482
847
|
*/
|
|
483
848
|
smol?: boolean;
|
|
484
849
|
/**
|
|
485
850
|
* Soft memory ceiling, in bytes, for each `bun test` child's resident set
|
|
486
851
|
* size (RSS). When set, the child's RSS is polled periodically; a run that
|
|
487
|
-
* exceeds this ceiling is killed and reported as a
|
|
488
|
-
*
|
|
852
|
+
* exceeds this ceiling is killed and reported as a Timeout for that one
|
|
853
|
+
* mutant, rather than being left to grow toward system-wide swap
|
|
489
854
|
* exhaustion. This is a polled userspace check, not a kernel-enforced
|
|
490
|
-
* limit — see
|
|
855
|
+
* limit — see "Memory containment" in docs/internals.md for why a true hard ceiling
|
|
491
856
|
* (rlimit/cgroup) isn't used. Omit to disable.
|
|
492
857
|
*/
|
|
493
858
|
maxChildRss?: number;
|
|
@@ -504,7 +869,7 @@ export interface BunTestRunnerOptions {
|
|
|
504
869
|
* project root, it picks up the project's entire suite — including the test
|
|
505
870
|
* that spawned it — and the nesting never terminates. This ceiling makes that
|
|
506
871
|
* finite: a run at or beyond the limit fails with a non-zero exit code
|
|
507
|
-
* instead of spawning. See
|
|
872
|
+
* instead of spawning. See "Recursion containment" in docs/internals.md.
|
|
508
873
|
*
|
|
509
874
|
* The default of 1 allows the runner's own `bun test` children and nothing
|
|
510
875
|
* deeper, which is right for every project whose tests do not themselves
|