test: add tests for handler, email, cmd/server, version and enforce 80% coverage

This commit is contained in:
2026-07-26 20:59:56 +02:00
parent 08554695da
commit 4dd7b6991d
8 changed files with 1295 additions and 6 deletions
+6 -2
View File
@@ -23,8 +23,12 @@ build:
go build -ldflags="-s -w" -o bin/nuntius ./cmd/server
test:
@echo "→ Running tests…"
go test ./...
@echo "→ Running all tests…"
go test -race -count=1 ./...
@echo "→ Checking coverage threshold (≥80% for internal + pkg)…"
go test -coverprofile=coverage.out ./internal/... ./pkg/...
@go tool cover -func=coverage.out | grep '^total:' | python3 -c "import sys; pct=float(sys.stdin.read().split()[2].rstrip('%')); sys.exit(0 if pct >= 80 else 1)" && echo "Coverage ✓" || (echo "ERROR: coverage < 80%"; exit 1)
@rm -f coverage.out
# Format Go source files
fmt: