zero-check-pipeline/validate
Travis Herbranson 145e0b0a98 tests: fix SIGPIPE under pipefail; use -print -quit instead of | head -1
`set -o pipefail` at the top of tests.sh combined with `find ... | head -1`
is a silent-killer pattern. When `find` produces lots of matches (e.g.
when uv has installed dozens of third-party packages with test_*.py
files under .venv), `head -1` reads its single line and closes the pipe.
`find` writes again, gets SIGPIPE, exits 141. pipefail propagates 141.
`set -e` fires. tests.sh exits 141 before printing `-- Python (pytest ...) --`
or any other output. run-all.sh records `tests: failed` with no
indication of WHY.

Reproduced directly:
    bash -c 'set -euo pipefail; x=$(find <large-tree> -name "test_*.py" -o -name "*_test.py" | head -1); echo "got: $x"'
    exit=141              # "got:" never prints

Fix: replace `| head -1` with `-print -quit` so find stops itself
after the first match instead of getting cut off mid-write. As a free
bonus, also prune the well-known noise dirs (.venv, .git, etc.) so the
probe doesn't even consider third-party test files in the first place —
this keeps the probe fast on dense trees and avoids matching
@pytest.fixture-decorated files in installed packages.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 07:51:33 -04:00
..
deps.sh validate: detect uv projects in deps.sh and tests.sh 2026-05-12 07:50:55 -04:00
lint.sh validate: fix path filter — explicit prune instead of "*/.*" trap 2026-05-12 07:50:32 -04:00
results.json v1 gauntlet: validation scripts with language detection and artifact generation 2026-04-18 11:30:24 -04:00
run-all.sh v1 gauntlet: validation scripts with language detection and artifact generation 2026-04-18 11:30:24 -04:00
sast.sh validate: fix path filter — explicit prune instead of "*/.*" trap 2026-05-12 07:50:32 -04:00
secrets.sh v1 gauntlet: validation scripts with language detection and artifact generation 2026-04-18 11:30:24 -04:00
SUMMARY.md v1 gauntlet: validation scripts with language detection and artifact generation 2026-04-18 11:30:24 -04:00
tests.sh tests: fix SIGPIPE under pipefail; use -print -quit instead of | head -1 2026-05-12 07:51:33 -04:00