Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 28 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: help build test test-unit test-integration test-endpoints test-publish test-all lint lint-fix validate validate-schemas validate-examples check dev-compose clean publisher generate-schema check-schema
.PHONY: help build test test-unit test-unit-verbose test-integration test-endpoints test-publish test-all lint lint-fix validate validate-schemas validate-examples check dev-compose clean publisher generate-schema check-schema

# Default target
help: ## Show this help message
Expand Down Expand Up @@ -28,15 +28,36 @@ check-schema: ## Check if server.schema.json is in sync with openapi.yaml
# Test targets
test-unit: ## Run unit tests with coverage (requires PostgreSQL)
@echo "Starting PostgreSQL for unit tests..."
@docker compose up -d postgres
@docker compose up -d postgres 2>&1 | grep -v "Pulling\|Pulled\|Creating\|Created\|Starting\|Started" || true
@echo "Waiting for PostgreSQL to be ready..."
@sleep 3
@echo ""
@echo "Running unit tests..."
go test -v -race -coverprofile=coverage.out -covermode=atomic ./internal/... ./cmd/...
go tool cover -html=coverage.out -o coverage.html
@echo "Coverage report generated: coverage.html"
@echo "Stopping PostgreSQL..."
@docker compose down postgres
@if command -v gotestsum >/dev/null 2>&1; then \
gotestsum --format pkgname-and-test-fails -- -race -coverprofile=coverage.out -covermode=atomic ./internal/... ./cmd/... 2>&1 | grep -v "ld: warning:"; \
else \
go test -race -coverprofile=coverage.out -covermode=atomic ./internal/... ./cmd/... 2>&1 | grep -v "ld: warning:" | grep -v "^ld:"; \
fi
@echo ""
@go tool cover -html=coverage.out -o coverage.html
@echo "✅ Coverage report: coverage.html"
@go tool cover -func=coverage.out | tail -1
@echo ""
@docker compose down postgres >/dev/null 2>&1
@echo "✅ Tests complete"

test-unit-verbose: ## Run unit tests with verbose output
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh I'd be fine just removing this completely

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, let's do that 👍

@claude - can you take care of that and file a PR to remove this target

Copy link
Contributor

@claude claude bot Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude encountered an error —— View job


I'll analyze this and get back to you.

@echo "Starting PostgreSQL for unit tests..."
@docker compose up -d postgres 2>&1 | grep -v "Pulling\|Pulled\|Creating\|Created\|Starting\|Started" || true
@echo "Waiting for PostgreSQL to be ready..."
@sleep 3
@echo ""
@echo "Running unit tests (verbose)..."
@go test -v -race -coverprofile=coverage.out -covermode=atomic ./internal/... ./cmd/... 2>&1 | grep -v "ld: warning:" | grep -v "^ld:"
@echo ""
@go tool cover -html=coverage.out -o coverage.html
@echo "✅ Coverage report: coverage.html"
@docker compose down postgres >/dev/null 2>&1

test: ## Run unit tests (use 'make test-all' to run all tests)
@echo "⚠️ Running unit tests only. Use 'make test-all' to run both unit and integration tests."
Expand Down
Loading