feat: implement comprehensive test optimization

- Add gotestsum for real-time test progress visibility
- Parallelize 174 tests across 14 files for faster execution
- Add -short mode support skipping 21 heavy integration tests
- Create testutil/db.go helper for future transaction rollbacks
- Fix data race in notification_service_test.go
- Fix 4 CrowdSec LAPI test failures with permissive validator

Performance improvements:
- Tests now run in parallel (174 tests with t.Parallel())
- Quick feedback loop via -short mode
- Zero race conditions detected
- Coverage maintained at 87.7%

Closes test optimization initiative
This commit is contained in:
GitHub Actions
2026-01-03 19:42:53 +00:00
parent 82d9b7aa11
commit 697ef6d200
58 changed files with 10742 additions and 59 deletions
+8 -2
View File
@@ -39,8 +39,14 @@ EXCLUDE_PACKAGES=(
# test failures after the coverage check.
# Note: Using -v for verbose output and -race for race detection
GO_TEST_STATUS=0
if ! go test -race -v -mod=readonly -coverprofile="$COVERAGE_FILE" ./...; then
GO_TEST_STATUS=$?
if command -v gotestsum &> /dev/null; then
if ! gotestsum --format pkgname -- -race -mod=readonly -coverprofile="$COVERAGE_FILE" ./...; then
GO_TEST_STATUS=$?
fi
else
if ! go test -race -v -mod=readonly -coverprofile="$COVERAGE_FILE" ./...; then
GO_TEST_STATUS=$?
fi
fi
if [ "$GO_TEST_STATUS" -ne 0 ]; then