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(tests): keep runner fixture source data out of browser launches [C7]

Corey Olson20f767c3be56
diff --git a/test/runner-browser-free-fixture.js b/test/runner-browser-free-fixture.js
index 7db3b40e..e3e74a11 100644
--- a/test/runner-browser-free-fixture.js
+++ b/test/runner-browser-free-fixture.js
@@ -8,19 +8,10 @@ import { pathToFileURL } from 'node:url';
import { listResources, takeResource } from '../src/resources.js';
import { runFixtureChild, runFixtureChildAsync } from './fixture-child.js';
import { HOST, installSshStandIn, shellQuote } from './runner-ssh-fixture.js';
+import { CHROME, FREE, MARKER } from './runner-browser-free-sources.js';
const SOURCE = resolve(import.meta.dirname, '..');
-// Browser-bound only under the broad classifier: a Node child with no Chrome reference.
-const FREE = "import { test } from 'node:test';\nimport { spawnSync } from 'node:child_process';\n"
- + "test('browser-free file ran', () => { if (spawnSync(process.execPath, ['-e', '0']).status !== 0) throw new Error('child failed'); });\n";
-// Browser-bound under either classifier: a process starter beside a Chrome executable name.
-const CHROME = "import { test } from 'node:test';\nimport { spawnSync } from 'node:child_process';\nconst chrome = 'google-chrome';\n"
- + "test('browser-bound file ran', () => { if (process.env.PULLBOARD_FIXTURE_NEVER_SET) spawnSync(chrome, ['--version']); });\n";
-// A test body that prints and throws the refusal text: an ordinary red, never a lease refusal.
-const MARKER = "import { test } from 'node:test';\n"
- + "test('marker file ran', () => { console.log('[BROWSER_SLOT_REQUIRED] printed by a test'); throw new Error('[BROWSER_SLOT_REQUIRED] thrown by a test'); });\n";
-
/** Count the stand-in's dispatched and returned markers. */
function phases(file) {
const lines = existsSync(file) ? readFileSync(file, 'utf8').split('\n') : [];
diff --git a/test/runner-browser-free-sources.js b/test/runner-browser-free-sources.js
new file mode 100644
index 00000000..417095d8
--- /dev/null
+++ b/test/runner-browser-free-sources.js
@@ -0,0 +1,11 @@
+/** Generated browser-admission fixture source data [C7]. */
+// Browser-bound only under the broad classifier: a Node child with no Chrome reference.
+export const FREE = "import { test } from 'node:test';\nimport { spawnSync } from 'node:child_process';\n"
+ + "test('browser-free file ran', () => { if (spawnSync(process.execPath, ['-e', '0']).status !== 0) throw new Error('child failed'); });\n";
+// Browser-bound under either classifier: a process starter beside a Chrome executable name.
+export const CHROME = "import { test } from 'node:test';\nimport { spawnSync } from 'node:child_process';\nconst chrome = 'google-chrome';\n"
+ + "test('browser-bound file ran', () => { if (process.env.PULLBOARD_FIXTURE_NEVER_SET) spawnSync(chrome, ['--version']); });\n";
+// A test body that prints and throws the refusal text: an ordinary red, never a lease refusal.
+export const MARKER = "import { test } from 'node:test';\n"
+ + "test('marker file ran', () => { console.log('[BROWSER_SLOT_REQUIRED] printed by a test'); throw new Error('[BROWSER_SLOT_REQUIRED] thrown by a test'); });\n";
+
diff --git a/test/test-resources.test.js b/test/test-resources.test.js
index 1782a478..ac131fe5 100644
--- a/test/test-resources.test.js
+++ b/test/test-resources.test.js
@@ -343,6 +343,7 @@ test('only a file that reaches a browser launch takes a browser slot [C7,O5]', a
assert.equal(listed.status, 0, listed.stderr);
const tracked = listed.stdout.split('\0').filter(path => /\.test\.(?:js|mjs)$/u.test(path)).sort();
const bound = await browserBoundFiles(repository, tracked, { byLaunch: true });
+ assert.ok(!bound.includes('test/runners.test.js'), 'runner subprocess fixture source data does not launch a browser in the runner test process');
const missed = CENSUS_LAUNCHED.filter(file => tracked.includes(file) && !bound.includes(file));
assert.deepEqual(missed, [], 'every file that launched Chrome in the census is classified browser-bound');
// Cockpit and journey files stay bound by rule until #741 guards the view fixture; the rest must reach a launch.