[PostGres Checkpointer] Run CI on PG15 as well (#1953)

This commit is contained in:
William FH
2024-10-02 19:16:58 +00:00
committed by GitHub
parent 7ede237508
commit 6c0da426c6
2 changed files with 20 additions and 7 deletions
+19 -6
View File
@@ -5,20 +5,33 @@
######################
start-postgres:
docker compose -f tests/compose-postgres.yml up -V --force-recreate --wait
POSTGRES_VERSION=${POSTGRES_VERSION:-16} docker compose -f tests/compose-postgres.yml up -V --force-recreate --wait
stop-postgres:
docker compose -f tests/compose-postgres.yml down
test:
make start-postgres; \
poetry run pytest; \
EXIT_CODE=$$?; \
POSTGRES_VERSIONS ?= 15 16
test_pg_version:
@echo "Testing PostgreSQL $(POSTGRES_VERSION)"
@POSTGRES_VERSION=$(POSTGRES_VERSION) make start-postgres
@poetry run pytest $(TEST)
@EXIT_CODE=$$?; \
make stop-postgres; \
echo "Finished testing PostgreSQL $(POSTGRES_VERSION); Exit code: $$EXIT_CODE"; \
exit $$EXIT_CODE
test:
@for version in $(POSTGRES_VERSIONS); do \
if ! make test_pg_version POSTGRES_VERSION=$$version; then \
echo "Test failed for PostgreSQL $$version"; \
exit 1; \
fi; \
done
@echo "All PostgreSQL versions tested successfully"
TEST ?= .
test_watch:
make start-postgres; \
POSTGRES_VERSION=${POSTGRES_VERSION:-16} make start-postgres; \
poetry run ptw $(TEST); \
EXIT_CODE=$$?; \
make stop-postgres; \
@@ -1,6 +1,6 @@
services:
postgres-test:
image: postgres:16
image: postgres:${POSTGRES_VERSION:-16}
ports:
- "5441:5432"
environment: