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:
+5
-2
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user