chore: add test runner to pre-commit hook with failure-only output
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 1m58s

This commit is contained in:
2026-05-31 01:42:34 +02:00
parent 6793461a9f
commit 2432f807be
8 changed files with 53 additions and 16 deletions
+24
View File
@@ -0,0 +1,24 @@
#!/bin/sh
# Run all tests and display only failing tests (plus a summary).
# Keeps output focused so commit context isn't bloated.
#
# NOTE: It doesn't matter if you didn't introduce the failing tests —
# they should be handled before committing. A red main branch helps no one.
cd "$(dirname "$0")/../.."
echo "🧪 Running tests (only failures will be shown)..."
# Disable TTY progress bars for clean pre-commit output.
# Use `--reporter=default` which prints only failures + the final summary.
CI=true npx vitest run --reporter=default 2>&1
EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
echo ""
echo "⛔ Commit blocked: failing tests found."
echo " It doesn't matter if you didn't introduce the failing tests —"
echo " they should be handled before committing."
fi
exit $EXIT_CODE