Skip to content

Commit bb0c8d0

Browse files
fix(92c2-b442): support indented FAIL lines in red-zone.sh parser
parse_failing_tests_from_output used ^FAIL: anchor which required FAIL: at line start. Most test scripts output " FAIL: test_name" with 2-space indent (203 instances across 20 files), making them invisible to the parser. When no test names are parsed, the fail-safe treats ALL failures as blocking, defeating RED zone tolerance. Removed the ^ anchor so both indented and non-indented FAIL: lines are matched. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8db1b7e commit bb0c8d0

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

plugins/dso/hooks/lib/red-zone.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ parse_failing_tests_from_output() {
8282
|| true
8383

8484
# Bash-style (assert_pass_if_clean): "FAIL: test_name" on stderr merged into output
85-
grep -oE '^FAIL: [a-zA-Z_][a-zA-Z0-9_-]*' "$output_file" \
85+
# No ^ anchor — many test scripts output indented " FAIL: test_name" lines
86+
grep -oE 'FAIL: [a-zA-Z_][a-zA-Z0-9_-]*' "$output_file" \
8687
| sed 's/^FAIL: //' \
8788
|| true
8889

tests/hooks/test-red-zone.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,16 @@ rm -f "$_out3"
141141
_failing4=$(parse_failing_tests_from_output "/tmp/nonexistent-red-zone-XXXXXX-abc")
142142
assert_eq "missing output file returns empty" "" "$_failing4"
143143

144+
# Test: indented "FAIL: test_name" lines (2-space indent) are parsed correctly
145+
_out5=$(make_temp_file)
146+
cat > "$_out5" <<'EOF'
147+
FAIL: test_indented_one
148+
FAIL: test_indented_two
149+
EOF
150+
_failing5=$(parse_failing_tests_from_output "$_out5" | sort | tr '\n' ',' | sed 's/,$//')
151+
assert_eq "indented FAIL: prefix format parsed" "test_indented_one,test_indented_two" "$_failing5"
152+
rm -f "$_out5"
153+
144154
# ============================================================
145155
# get_test_line_number tests
146156
# ============================================================

0 commit comments

Comments
 (0)