From 30545d0d88b7801ca3e98a6785c5192bf2c11578 Mon Sep 17 00:00:00 2001 From: npeter83 Date: Sun, 4 Oct 2026 22:18:09 +0200 Subject: [PATCH] fix(gate): --brief leaves the test database's own log out of an excerpt The DB lane provokes constraint errors on purpose, and their ERROR: lines from the testdb container came first in a red pytest excerpt, ahead of the failing test (seen in E35 S3). The excerpt now skips the testdb-N lines. --- frontend/src/lib/gates.snapshot.json | 3 ++- scripts/check.sh | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/gates.snapshot.json b/frontend/src/lib/gates.snapshot.json index 259589c9..1dfc1a19 100644 --- a/frontend/src/lib/gates.snapshot.json +++ b/frontend/src/lib/gates.snapshot.json @@ -1392,7 +1392,8 @@ "}", "brief_excerpt() {", " local hits", - " hits=\"$(grep -E -i -A 2 -m 20 'error|fail|✗|×|warn|would reformat|unused|vulnerab|found [0-9]' \"$1\")\"", + " hits=\"$(grep -v -E '^testdb-[0-9]+ ' \"$1\" |", + " grep -E -i -A 2 -m 20 'error|fail|✗|×|warn|would reformat|unused|vulnerab|found [0-9]')\"", " if [ -n \"$hits\" ]; then printf '%s\\n' \"$hits\"; else tail -n 20 \"$1\"; fi", "}", "ruff_pinned() {", diff --git a/scripts/check.sh b/scripts/check.sh index 66f3b95a..3b374bc7 100644 --- a/scripts/check.sh +++ b/scripts/check.sh @@ -50,10 +50,13 @@ lane() { # lane — run it, remember a failure, never stop } # The lines that say what broke: the first 20 error-looking ones, each with the two lines after it # (knip names the file on the line after "Unused files"); a log with none of them (a tool that -# words its failures some other way) shows its tail instead, which is where a summary sits. +# words its failures some other way) shows its tail instead, which is where a summary sits. The test +# database's own log is left out: the DB lane provokes constraint errors on purpose, and its +# `ERROR:` lines filled the excerpt ahead of the failing test. brief_excerpt() { local hits - hits="$(grep -E -i -A 2 -m 20 'error|fail|✗|×|warn|would reformat|unused|vulnerab|found [0-9]' "$1")" + hits="$(grep -v -E '^testdb-[0-9]+ ' "$1" | + grep -E -i -A 2 -m 20 'error|fail|✗|×|warn|would reformat|unused|vulnerab|found [0-9]')" if [ -n "$hits" ]; then printf '%s\n' "$hits"; else tail -n 20 "$1"; fi }