Skip to content

Commit fe1c974

Browse files
hyperpolymathclaude
andcommitted
fix(ci): stop the new OCaml gate crying wolf on "Failed: 0"
The gate's first run went red on a test suite that reported ZERO failures. The FAIL-marker check was case-insensitive and unanchored on the right, so `^[[:space:]]*FAIL` matched the compositional suite's "Failed: 0" summary line. A gate that cries wolf is worse than no gate — it trains maintainers to ignore it. Now requires a FAIL *marker*: "FAIL" followed by ':' or whitespace, matched case-sensitively. Verified in both directions against the real test output: no false positive on a passing run, still catches an injected " FAIL Braid equality true", and "Failed: 0" is correctly ignored. The tally check also now covers the "Failed: N" shape it previously missed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent b49a3b7 commit fe1c974

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/ocaml-ci.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,20 @@ jobs:
7575
# "FAIL" line: several suites print their own tally and would
7676
# otherwise report failures while still exiting 0.
7777
dune test --force 2>&1 | tee /tmp/dune-test.log
78-
if grep -qiE '^[[:space:]]*FAIL' /tmp/dune-test.log; then
78+
# Match a FAIL *marker* only: "FAIL" followed by ':' or whitespace.
79+
# NOT case-insensitive, and NOT bare "FAIL" — several suites print a
80+
# "Failed: 0" tally, which a looser pattern flags as a failure. (It
81+
# did: this gate's first run went red on a suite reporting zero
82+
# failures. A gate that cries wolf is worse than no gate.)
83+
if grep -qE '^[[:space:]]*FAIL([:[:space:]])' /tmp/dune-test.log; then
7984
echo "::error::A test reported FAIL — see the log above."
85+
grep -nE '^[[:space:]]*FAIL([:[:space:]])' /tmp/dune-test.log | head -20
8086
exit 1
8187
fi
82-
if grep -qE '[1-9][0-9]* failed' /tmp/dune-test.log; then
88+
# Nonzero tallies, in either shape the suites use.
89+
if grep -qE '([1-9][0-9]*) failed|Failed:[[:space:]]*[1-9]' /tmp/dune-test.log; then
8390
echo "::error::A suite reported a nonzero failure count."
84-
grep -nE '[1-9][0-9]* failed' /tmp/dune-test.log
91+
grep -nE '([1-9][0-9]*) failed|Failed:[[:space:]]*[1-9]' /tmp/dune-test.log
8592
exit 1
8693
fi
8794
echo "OCaml compiler: build + all suites GREEN."

0 commit comments

Comments
 (0)