hammer-editor/.gitHooks/pre-commit
Adam Brown f55009ae34
Skip slow server tests in the pre-commit hook
The server test suite now runs against embedded PostgreSQL and takes
~10 minutes per run — too slow to gate every commit. The hook now only
runs `desktopTest`. Run `:server:test` manually before pushing, or rely
on CI to catch server-side regressions.
2026-05-21 01:58:06 -07:00

17 lines
No EOL
442 B
Bash
Executable file

#!/bin/bash
# Change to the root directory of your project
#cd /path/to/your/project/root
# Run fast test suites. `:server:test` is excluded because the embedded
# PostgreSQL make it too slow for every commit.
./gradlew desktopTest
# Check the exit code of the test task
if [ $? -ne 0 ]; then
echo "Error: tests failed. Please fix the failing tests before committing."
exit 1
fi
# If the tests pass, allow the commit to proceed
exit 0