fix(shell): remove test harness pipe hazards
ci/woodpecker/pr/ci Pipeline was successful

This commit is contained in:
2026-08-07 04:50:52 -05:00
parent 3a1203b2f8
commit 7dd04ecc22
15 changed files with 120 additions and 30 deletions
+31 -6
View File
@@ -7,6 +7,7 @@ import test from 'node:test';
const ROOT = new URL('../', import.meta.url);
const EXPECTED_BASELINE_SITES = 26;
const EXPECTED_TEST_BASELINE_SITES = 22;
const TARGETS = [
'tools/matrix-presence-harness/run.sh',
'tools/e2e-install-test.sh',
@@ -25,6 +26,17 @@ const TARGETS = [
'packages/mosaic/framework/tools/wake/detector.sh',
'packages/mosaic/framework/tools/wake/digest.sh',
'packages/mosaic/framework/tools/wake/reconcile.sh',
'packages/mosaic/framework/systemd/user/test-fleet-units.sh',
'packages/mosaic/framework/tools/git/test-issue-comment-readback.sh',
'packages/mosaic/framework/tools/git/test-lane-brief-pr-linkage.sh',
'packages/mosaic/framework/tools/git/test-pr-review-gitea-comment.sh',
'packages/mosaic/framework/tools/git/test-pr-review-repo-host-override.sh',
'packages/mosaic/framework/tools/orchestrator/smoke-test.sh',
'packages/mosaic/framework/tools/orchestrator/test-board-roll.sh',
'packages/mosaic/framework/tools/quality/scripts/test-upgrade-durable-snapshot.sh',
'packages/mosaic/framework/tools/quality/scripts/test-upgrade-rollback.sh',
'packages/mosaic/framework/tools/tmux/test-send-message-socket.sh',
'packages/mosaic/framework/tools/tmux/test-send-message-verdict.sh',
];
// These statuses are explicitly non-load-bearing or unreachable at designed input.
@@ -67,18 +79,31 @@ async function currentSources() {
);
}
test('the registered baseline denominator is exactly 26 unsafe sites', async () => {
const baseline = JSON.parse(
await readFile(new URL('scripts/fixtures/pipefail-early-exit-baseline.json', ROOT), 'utf8'),
);
assert.equal(baseline.length, EXPECTED_BASELINE_SITES);
assert.equal(new Set(baseline).size, EXPECTED_BASELINE_SITES);
async function assertBaselineFixture(file, expectedCount, expectedUnique = expectedCount) {
const baseline = JSON.parse(await readFile(new URL(file, ROOT), 'utf8'));
assert.equal(baseline.length, expectedCount);
assert.equal(new Set(baseline).size, expectedUnique);
const fixtureSources = baseline.map((site) => {
const separator = site.indexOf(':');
assert.ok(separator > 0, `invalid baseline site: ${site}`);
return [site.slice(0, separator), site.slice(separator + 1)];
});
assert.deepEqual(scan(fixtureSources), baseline);
}
test('the registered runtime baseline denominator is exactly 26 unsafe sites', async () => {
await assertBaselineFixture(
'scripts/fixtures/pipefail-early-exit-baseline.json',
EXPECTED_BASELINE_SITES,
);
});
test('the registered test baseline denominator is exactly 22 unsafe sites', async () => {
await assertBaselineFixture(
'scripts/fixtures/pipefail-early-exit-test-baseline.json',
EXPECTED_TEST_BASELINE_SITES,
21,
);
});
test('load-bearing pipefail paths do not pipe into early-exiting consumers', async () => {