Better integration test.
Some checks failed
CI / Test (1.25) (push) Successful in -25m30s
CI / Lint (push) Successful in -25m32s
CI / Build (push) Successful in -26m1s
Integration Tests / Integration Tests (push) Failing after -26m1s
CI / Test (1.24) (push) Successful in 3m1s

This commit is contained in:
2025-12-28 15:37:21 +02:00
parent 0fb3469dbd
commit 27da24f575
7 changed files with 33 additions and 53 deletions

View File

@@ -52,7 +52,7 @@ test-integration: ## Run integration tests (requires RELSPEC_TEST_PG_CONN enviro
@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'"; \
echo "Example: export RELSPEC_TEST_PG_CONN='postgres://relspec:relspec_test_password@localhost:5439/relspec_test'"; \
exit 1; \
fi
@echo "Running PostgreSQL reader tests..."
@@ -116,7 +116,7 @@ docker-up: ## Start PostgreSQL test database
-e POSTGRES_USER=relspec \
-e POSTGRES_PASSWORD=relspec_test_password \
-e POSTGRES_DB=relspec_test \
-p 5433:5432 \
-p 5439:5432 \
-v ./tests/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql:Z \
postgres:16-alpine 2>/dev/null || echo "Container already running"; \
else \
@@ -124,8 +124,8 @@ docker-up: ## Start PostgreSQL test database
fi
@echo "Waiting for PostgreSQL to be ready..."
@sleep 3
@echo "PostgreSQL is running on port 5433"
@echo "Connection: postgres://relspec:relspec_test_password@localhost:5433/relspec_test"
@echo "PostgreSQL is running on port 5439"
@echo "Connection: postgres://relspec:relspec_test_password@localhost:5439/relspec_test"
docker-down: ## Stop PostgreSQL test database
@echo "Stopping PostgreSQL test database (using $(CONTAINER_RUNTIME))..."
@@ -147,7 +147,7 @@ docker-test: ## Run PostgreSQL integration tests with Docker/Podman
docker-test-integration: docker-up ## Start DB and run integration tests
@echo "Running integration tests..."
@sleep 2
@RELSPEC_TEST_PG_CONN="postgres://relspec:relspec_test_password@localhost:5433/relspec_test" \
@RELSPEC_TEST_PG_CONN="postgres://relspec:relspec_test_password@localhost:5439/relspec_test" \
$(GOTEST) -v ./pkg/readers/pgsql/ -count=1 || (make docker-down && exit 1)
@make docker-down