From d75963de10d696f3051ba1993a9ae51b4023a52f Mon Sep 17 00:00:00 2001 From: archipelago Date: Wed, 19 Aug 2026 14:33:09 -0400 Subject: [PATCH] fix(gate): show which UI test failed instead of swallowing it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ui-unit-tests stage piped vitest through `tail -4`, which cut off the failure block. A red gate reported "1 failed | 999 passed" and nothing else — no file, no test name, no assertion — so the failure could not be diagnosed after the run. Success still prints the quiet 4-line summary; failure now dumps the full log and keeps it on disk so a scrolled-off terminal isn't the end of it. Verified both paths: green run unchanged, and a deliberately failing spec now surfaces its file, test name, assertion and line number. Co-Authored-By: Claude Opus 5 (1M context) --- tests/release/run.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/release/run.sh b/tests/release/run.sh index 6d047a00..dec58bf1 100755 --- a/tests/release/run.sh +++ b/tests/release/run.sh @@ -75,7 +75,20 @@ fi # ── Stage 2: frontend ──────────────────────────────────────────────── stage "ui-type-check" bash -c 'cd neode-ui && npm run --silent type-check' -stage "ui-unit-tests" bash -c 'cd neode-ui && npx vitest run --silent 2>&1 | tail -4; exit ${PIPESTATUS[0]}' +# A red vitest run must name the failing test. `| tail -4` used to swallow the +# failure block, so the gate reported only "1 failed" and nothing else — +# undiagnosable after the fact. Quiet 4-line summary on success, full log on +# failure (kept on disk so a scrolled-off terminal is not the end of it). +ui_unit_tests() { + local log; log=$(mktemp -t vitest-gate.XXXXXX.log) + if ( cd neode-ui && npx vitest run --silent ) >"$log" 2>&1; then + tail -4 "$log"; rm -f "$log"; return 0 + fi + echo "──── vitest FAILED — full log kept at $log ────" + cat "$log" + return 1 +} +stage "ui-unit-tests" ui_unit_tests if [[ $WITH_BUILD -eq 1 ]]; then # npm run build can fail silently (vue-tsc EACCES burned us before) —