diff --git a/validate/tests.sh b/validate/tests.sh index cadb2fa..2fd86ed 100755 --- a/validate/tests.sh +++ b/validate/tests.sh @@ -11,8 +11,18 @@ errors=0 echo "=== Test Suite ===" -has_python=$(find "$TARGET" -name "test_*.py" -o -name "*_test.py" | head -1) -has_go=$(find "$TARGET" -name "*_test.go" | head -1) +# Probe for test files. Prune known noise dirs so we don't trip on +# third-party test files installed under .venv, and use -print -quit so +# the probe doesn't SIGPIPE under `set -o pipefail` on dense trees +# (which exits the script silently with status 141 before any stage +# output is printed). +has_python=$(find "$TARGET" \ + \( -path '*/__pycache__' -o -path '*/.venv' -o -path '*/venv' \ + -o -path '*/.git' -o -path '*/node_modules' \) -prune \ + -o \( -name 'test_*.py' -o -name '*_test.py' \) -print -quit) +has_go=$(find "$TARGET" \ + \( -path '*/.git' -o -path '*/vendor' -o -path '*/node_modules' \) -prune \ + -o -name '*_test.go' -print -quit) if [ -z "$has_python" ] && [ -z "$has_go" ]; then printf "${YELLOW}!${NC} No test files found — skipping\n"