Skip to content

Commit

Permalink
[PostGres Checkpointer] Run CI on PG15 as well (#1953)
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw authored Oct 2, 2024
1 parent 7ede237 commit 6c0da42
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
25 changes: 19 additions & 6 deletions libs/checkpoint-postgres/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
Expand Down
2 changes: 1 addition & 1 deletion libs/checkpoint-postgres/tests/compose-postgres.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
postgres-test:
image: postgres:16
image: postgres:${POSTGRES_VERSION:-16}
ports:
- "5441:5432"
environment:
Expand Down

0 comments on commit 6c0da42

Please sign in to comment.