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.
This commit is contained in:
2026-10-05 00:19:39 +02:00
parent ac702192c9
commit 30545d0d88
2 changed files with 7 additions and 3 deletions
+2 -1
View File
@@ -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() {",
+5 -2
View File
@@ -50,10 +50,13 @@ lane() { # lane <name> <command…> — 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
}