Build/test fixes
Some checks failed
CI / Test (1.24) (push) Failing after -24m25s
CI / Test (1.25) (push) Failing after -24m5s
CI / Lint (push) Successful in -25m6s
CI / Build (push) Successful in -25m25s
Integration Tests / Integration Tests (push) Failing after -25m39s

This commit is contained in:
2025-12-28 14:21:57 +02:00
parent e61204cb3c
commit beb5b4fac8
3 changed files with 125 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
.PHONY: all build test lint coverage clean install help docker-up docker-down docker-test docker-test-integration
.PHONY: all build test test-unit test-integration lint coverage clean install help docker-up docker-down docker-test docker-test-integration
# Binary name
BINARY_NAME=relspec
@@ -22,9 +22,23 @@ build: ## Build the binary
$(GOBUILD) -o $(BUILD_DIR)/$(BINARY_NAME) ./cmd/relspec
@echo "Build complete: $(BUILD_DIR)/$(BINARY_NAME)"
test: ## Run tests
@echo "Running tests..."
$(GOTEST) -v -race -coverprofile=coverage.out ./...
test: test-unit ## Run all unit tests (alias for test-unit)
test-unit: ## Run unit tests (excludes integration tests)
@echo "Running unit tests..."
$(GOTEST) -v -race -coverprofile=coverage.out -covermode=atomic $$(go list ./... | grep -v '/tests/integration' | grep -v '/pkg/readers/pgsql')
test-integration: ## Run integration tests (requires RELSPEC_TEST_PG_CONN environment variable)
@echo "Running integration tests..."
@if [ -z "$$RELSPEC_TEST_PG_CONN" ]; then \
echo "Error: RELSPEC_TEST_PG_CONN environment variable is not set"; \
echo "Example: export RELSPEC_TEST_PG_CONN='postgres://relspec:relspec_test_password@localhost:5432/relspec_test'"; \
exit 1; \
fi
@echo "Running PostgreSQL reader tests..."
$(GOTEST) -v -count=1 ./pkg/readers/pgsql/
@echo "Running general integration tests..."
$(GOTEST) -v -count=1 ./tests/integration/
coverage: test ## Run tests with coverage report
@echo "Generating coverage report..."