test: add tests for handler, email, cmd/server, version and enforce 80% coverage
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user