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(land): a name waiver keeps a landing run going too [B3,C7]

Corey Olsonadaedb33cc4f
diff --git a/bin/run-tests.js b/bin/run-tests.js
index a04c383f..9912178c 100644
--- a/bin/run-tests.js
+++ b/bin/run-tests.js
@@ -1054,6 +1054,8 @@ async function runLandingTests(args, env, concurrency) {
if (file && details?.passed === false && (details.type === undefined || details.type === 'test') && !firstFailure) {
// A failure a live person waiver covers does not stop the run; every other file still runs.
if (landingFailureWaived(waivers, file, name)) { waivedFiles.set(file, waivedFiles.get(file) ?? true); return; }
+ // A file or suite failing only through its tests was decided by those tests already.
+ if (waivers.length && details.error?.failureType === 'subtestsFailed' && waivedFiles.get(file) === true) return;
waivedFiles.set(file, false);
firstFailure = { file, name, error: details.error };
abortLandingRun();
diff --git a/test/land.test.js b/test/land.test.js
index 06441f2a..88a9d958 100644
--- a/test/land.test.js
+++ b/test/land.test.js
@@ -766,6 +766,17 @@ test("a person's waiver lets a submit and a landing gate through only the waived
assert.ok(existsSync(laterRan), 'every other file ran past the waived failure');
assert.doesNotMatch(`${continued.out}\n${continued.err}`, /stopped early/u);
assert.match(continued.out, new RegExp(`waived: a flaky landing check \\(${waivedFile.replaceAll('.', '\\.')}\\) by person waiver ${runnerWaiver.id} for file `, 'u'));
+ // A waiver by exact test name keeps the run going too, past the file that holds that test.
+ const namedFile = 'test/landing-named.test.cjs';
+ assert.equal(commitFile(box, box.repo, namedFile, "require('node:test').test('a named landing flake', () => { throw new Error('known flake'); });\n", 'chore: add a named flaky landing test').status, 0);
+ setGate(`node ${JSON.stringify(join(dirname(BIN), 'run-tests.js'))} --test-concurrency=1 ${namedFile} test/landing-later.test.cjs`, 'chore: gate the named flake with the real test runner');
+ const nameWaiver = json(box, box.repo, 'land', '--waive', 'a named landing flake', '--until', '2099-01-01', '--reason', 'known named flake').waiver;
+ rmSync(laterRan);
+ const named = box.run(box.repo, 'gate', '--landing');
+ assert.equal(named.code, 0, `${named.err}\n${named.out}`);
+ assert.ok(existsSync(laterRan), 'every other file ran past the failure waived by name');
+ assert.doesNotMatch(`${named.out}\n${named.err}`, /stopped early/u);
+ assert.match(named.out, new RegExp(`waived: a named landing flake \\(${namedFile.replaceAll('.', '\\.')}\\) by person waiver ${nameWaiver.id} for name a named landing flake: known named flake`, 'u'));
setGate(gateCommand, 'chore: restore the single-stage gate');
onBoard(box, (board) => {