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(gate): keep run-tests in its line bucket after the trunk merge [C7]

Corey Olsone69e46b7f620
diff --git a/bin/run-tests.js b/bin/run-tests.js
index f0d56971..5de70884 100644
--- a/bin/run-tests.js
+++ b/bin/run-tests.js
@@ -225,7 +225,6 @@ function testEnvironment(sandbox, gateMarkers = {}) {
isolateTestMachine(env, sandbox); // #1068: no settings, resources, runners or host markers of the real machine.
// init and resume start a background view by default; a test opts back in by deleting this.
env.PULLBOARD_VIEW_BACKGROUND = '0';
- env.PULLBOARD_TEST_REUSE = '0'; // A runner a test starts runs every file it names; a test opts in to reuse by deleting this.
env.TMPDIR = sandbox;
env.TMP = sandbox;
env.TEMP = sandbox;
@@ -1444,7 +1443,6 @@ async function main(args) {
const { testsNeedBrowser } = await import('../src/browser-admission.js');
browser = await testsNeedBrowser(process.cwd(), explicitTestFiles(args));
}
- // A test file whose inputs did not change since a green run is reused, not run again (#1045).
const actions = await (await import('../src/test-action-cache.js')).planTestActions(process.cwd(), args, { fullSuite, landing: process.env[LANDING_RUN_ENV] === '1', listFiles: () => fullSuite ? trackedDefaultTestFiles(process.cwd(), process.env) : explicitTestFiles(args) });
if (actions.done) return;
let signal = null;
@@ -1536,7 +1534,7 @@ if (process.argv[1] && resolve(process.argv[1]) === runner) {
await main(process.argv.slice(2));
} else if (process.argv[1]) {
process.env.PULLBOARD_TEST_FILE = process.argv[1];
- if (process.env.PULLBOARD_TEST_ACTIONS) (await import('../src/test-action-cache.js')).recordTestAction(process.argv[1]);
+ (await import('../src/test-action-cache.js')).recordTestAction(process.argv[1]); // #1045: reuse off below; record this file.
const fileTimes = process.env[LANDING_FILE_TIMES_ENV];
// Only this test file reports; anything it starts is not one of the shard's files.
delete process.env[LANDING_FILE_TIMES_ENV];
diff --git a/src/test-action-cache.js b/src/test-action-cache.js
index 82a505b8..39e017b8 100644
--- a/src/test-action-cache.js
+++ b/src/test-action-cache.js
@@ -370,11 +370,13 @@ export function settleTestActions(runDir, { store, stage, commit, landing, code
/**
* In a test file's own process: record its outcome when it exits. Exit 0 stages a green for the parent to promote; any
* other exit marks the key red at once, so it is never reused. A process killed for a timeout records nothing, so its
- * file runs again. The marker leaves the environment here, so nothing this file starts records as it.
+ * file runs again. The marker leaves the environment here, so nothing this file starts records as it, and any runner
+ * this file starts runs every file it names (a test opts in to reuse by deleting PULLBOARD_TEST_REUSE).
*
* @param {string} file the test file's path, as the process received it
*/
export function recordTestAction(file) {
+ process.env.PULLBOARD_TEST_REUSE = '0';
const runDir = process.env[TEST_ACTIONS_ENV];
delete process.env[TEST_ACTIONS_ENV];
if (!runDir || process.env.NODE_TEST_CONTEXT !== 'child-v8') return;