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
@@ -0,0 +1,24 @@
[
"packages/mosaic/framework/systemd/user/test-fleet-units.sh:if tmux -L \"$TEST_SOCKET\" show-environment -g LD_PRELOAD 2>/dev/null | grep -q '^LD_PRELOAD='; then",
"packages/mosaic/framework/tools/git/test-issue-comment-readback.sh:write_response \"$(printf '%s' \"$result\" | head -n1)\" \"$(printf '%s' \"$result\" | tail -n +2)\"",
"packages/mosaic/framework/tools/git/test-issue-comment-readback.sh:write_response \"$(printf '%s' \"$result\" | head -n1)\" \"$(printf '%s' \"$result\" | tail -n +2)\"",
"packages/mosaic/framework/tools/git/test-lane-brief-pr-linkage.sh:contains() { printf '%s\\n' \"$1\" | grep -qx \"$2\"; }",
"packages/mosaic/framework/tools/git/test-pr-review-gitea-comment.sh:write_response \"$(printf '%s' \"$result\" | head -n1)\" \"$(printf '%s' \"$result\" | tail -n +2)\"",
"packages/mosaic/framework/tools/git/test-pr-review-repo-host-override.sh:echo \"$HELP_TEXT\" | grep -q -- '-r, --repo'",
"packages/mosaic/framework/tools/git/test-pr-review-repo-host-override.sh:echo \"$HELP_TEXT\" | grep -q -- '-H, --host'",
"packages/mosaic/framework/tools/orchestrator/smoke-test.sh:if [[ \"$(printf '%s\\n' \"$codex_run_prompt\" | head -n1)\" == \"Now initiating Orchestrator mode...\" ]]; then pass_case \"codex run prompt first line is mode declaration\"; else fail_case \"codex run prompt first line is mode declaration\"; fi",
"packages/mosaic/framework/tools/orchestrator/smoke-test.sh:if [[ \"$(printf '%s\\n' \"$claude_run_prompt\" | head -n1)\" == \"## Continuation Mission\" ]]; then pass_case \"claude run prompt remains continuation prompt format\"; else fail_case \"claude run prompt remains continuation prompt format\"; fi",
"packages/mosaic/framework/tools/orchestrator/test-board-roll.sh:echo \"$out\" | grep -qi \"dry run\" || note \"dry-run did not announce itself\"",
"packages/mosaic/framework/tools/orchestrator/test-board-roll.sh:echo \"$out\" | grep -q \"would roll\" || note \"dry-run did not report a plan\"",
"packages/mosaic/framework/tools/quality/scripts/test-upgrade-durable-snapshot.sh:find \"$1/mosaic/backups\" -maxdepth 1 -type d -name 'pre-update-*' 2>/dev/null | LC_ALL=C sort -r | head -1",
"packages/mosaic/framework/tools/quality/scripts/test-upgrade-rollback.sh:SNAP_E=\"$(grep -o '/[^ ]*mosaic-snapshot[^ ]*' \"$OUTG\" | head -1)\"",
"packages/mosaic/framework/tools/quality/scripts/test-upgrade-rollback.sh:grep -o '/[^ ]*mosaic-snapshot[^ ]*' \"$OUTH\" 2>/dev/null | head -1 | while read -r s; do rm -rf \"$s\"; done",
"packages/mosaic/framework/tools/tmux/test-send-message-socket.sh:capture_named | grep -qF \"named socket hello\" || fail \"send-message.sh did not deliver to named socket\"",
"packages/mosaic/framework/tools/tmux/test-send-message-socket.sh:if capture_default | grep -qF \"named socket hello\"; then",
"packages/mosaic/framework/tools/tmux/test-send-message-socket.sh:capture_named | grep -qF \"[tester:source ->\" || fail \"agent-send.sh did not include preamble\"",
"packages/mosaic/framework/tools/tmux/test-send-message-socket.sh:capture_named | grep -qF \"agent socket hello\" || fail \"agent-send.sh did not deliver to named socket\"",
"packages/mosaic/framework/tools/tmux/test-send-message-socket.sh:if capture_default | grep -qF \"agent socket hello\"; then",
"packages/mosaic/framework/tools/tmux/test-send-message-socket.sh:printf '%s' \"$pane\" | grep -qF \"CONCPAYLOAD-${i}-END\" || fail \"concurrent send dropped payload for pane conc-$i\"",
"packages/mosaic/framework/tools/tmux/test-send-message-socket.sh:if printf '%s' \"$pane\" | grep -qF \"CONCPAYLOAD-${j}-END\"; then",
"packages/mosaic/framework/tools/tmux/test-send-message-verdict.sh:if [ \"$rc\" -eq 0 ] && printf '%s' \"$out\" | grep -qF \"✓ delivered\"; then"
]
+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 () => {