feat(tests): add PostgreSQL readiness check in test setup
Integration Tests / integration-test (push) Failing after 1m10s
Integration Tests / integration-test (push) Failing after 1m10s
This commit is contained in:
@@ -80,6 +80,16 @@ test-setup: build ## Start test environment (docker-compose/podman-compose)
|
||||
exit 1; \
|
||||
fi
|
||||
@$(COMPOSE_CMD) -f tests/docker-compose.yml up -d
|
||||
@echo "Waiting for PostgreSQL to be ready..."
|
||||
@for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do \
|
||||
if $(COMPOSE_CMD) -f tests/docker-compose.yml exec -T postgres pg_isready -U user > /dev/null 2>&1; then \
|
||||
echo "PostgreSQL is ready"; exit 0; \
|
||||
fi; \
|
||||
sleep 2; \
|
||||
done; \
|
||||
echo "ERROR: PostgreSQL did not become ready in time"; \
|
||||
$(COMPOSE_CMD) -f tests/docker-compose.yml logs postgres; \
|
||||
exit 1
|
||||
|
||||
test-teardown: ## Stop test environment (docker-compose/podman-compose)
|
||||
@echo "Stopping test environment (using $(COMPOSE_CMD))..."
|
||||
|
||||
Reference in New Issue
Block a user