Skip to content

Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.

fix: reject underscore isolation aliases in bounded tests [C7]

Corey Olsonebfb8c62c367
diff --git a/bin/run-tests.js b/bin/run-tests.js
index 0e1255d6..e85440ff 100644
--- a/bin/run-tests.js
+++ b/bin/run-tests.js
@@ -247,7 +247,7 @@ function runTests(args, env, concurrency) {
throw new Error('--test-concurrency must be a positive integer');
}
files = Math.min(files, Number(value));
- } else if (/^--(?:experimental-)?test[-_]isolation(?:=none|$)/u.test(argument) &&
+ } else if (/^--(?:experimental[-_])?test[-_]isolation(?:=none|$)/u.test(argument) &&
(argument.endsWith('=none') || args[at + 1] === 'none')) {
throw new Error('bounded browser test files require process isolation; remove --test-isolation=none');
} else forwarded.push(argument);
diff --git a/test/gate.test.js b/test/gate.test.js
index a3bb34ee..f6dcc1f0 100644
--- a/test/gate.test.js
+++ b/test/gate.test.js
@@ -4,7 +4,7 @@
*/
import assert from 'node:assert/strict';
import { runFixtureExecFile as execFileSync, runFixtureChild as spawnSync, runFixtureChild, runFixtureGit } from './fixture-child.js';
-import { cpSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
+import { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join, resolve } from 'node:path';
import { after, test } from 'node:test';
@@ -80,6 +80,20 @@ test('record real file ${id} [C7]', async () => {
assert.match(result.stdout, /# tests 9\b/);
assert.match(result.stdout, /# fail 0\b/);
}
+ let isolationCase = 0;
+ for (const flag of ['--test-isolation', '--test_isolation', '--experimental-test-isolation',
+ '--experimental_test_isolation', '--experimental_test-isolation', '--experimental-test_isolation']) {
+ for (const args of [[`${flag}=none`], [flag, 'none']]) {
+ const capture = join(root, `isolation-${isolationCase++}.jsonl`);
+ const result = runFixtureChild(process.execPath, [join(root, 'bin/run-tests.js'), ...args, selected.at(-1)], {
+ cwd: root, env: { ...process.env, PULLBOARD_CAP_CAPTURE: capture,
+ PULLBOARD_MACHINE_HOME: join(root, 'machine-isolation') }, encoding: 'utf8',
+ });
+ assert.notEqual(result.status, 0, `${args.join(' ')} must refuse non-isolated test files`);
+ assert.match(result.stderr, /bounded browser test files require process isolation/u);
+ assert.equal(existsSync(capture), false, 'a refused isolation mode never starts a test-file body');
+ }
+ }
writeFileSync(config, JSON.stringify({ testConcurrency: { browser: 3 } }));
assert.throws(() => testConcurrency(root, 7), /browser must be 1 or 2/);
});