ci: run postgres integration tests#2637
Draft
jucor wants to merge 1 commit into
Draft
Conversation
This was referenced Jul 18, 2026
Closed
Closed
Closed
Closed
Closed
Closed
Closed
Closed
Closed
jucor
marked this pull request as draft
July 18, 2026 13:28
jucor
force-pushed
the
spr/edge/62486a46
branch
2 times, most recently
from
July 18, 2026 13:35
94a5915 to
0e191f5
Compare
This was referenced Jul 18, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Delphi CI workflow so the opt-in Postgres integration tests actually execute in GitHub Actions by wiring them to a shared, migrated Postgres service and by refactoring the poller integration test to use the shared Postgres provision/verification helper.
Changes:
- Refactors
delphi/tests/poller/test_integration_postgres.pyto obtain its database viarequire_polis_postgres()rather than provisioning its own fixed-port Postgres container. - Updates
.github/workflows/python-ci.ymlto exportPOLIS_TEST_POSTGRES_URLinside the Delphi test container and to copydelphi/scriptsinto the container for the generator integration test.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
delphi/tests/poller/test_integration_postgres.py |
Switches the integration test to the shared require_polis_postgres() provisioning/verification path. |
.github/workflows/python-ci.yml |
Exports POLIS_TEST_POSTGRES_URL for integration tests and attempts to stage generator scripts into the CI test container. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+102
to
+103
| echo "Copying scripts/ (cold-start generator under integration test) into container..." | ||
| docker compose -f docker-compose.test.yml cp delphi/scripts delphi:/app/scripts |
Make the opt-in Postgres integration tests actually execute in CI, and share the provisioning path. - Refactor tests/poller/test_integration_postgres.py to obtain its DB via the shared require_polis_postgres() helper (introduced in the T2 commit) instead of its own inline throwaway-docker fixture on fixed port 5435. It now applies 000000 + 000006 and uses an ephemeral port (xdist-safe), or the CI service. - python-ci.yml step 6: export POLIS_TEST_POSTGRES_URL pointing at the compose `postgres` service (docker-compose.test.yml), whose image already bakes the polis migrations via docker-entrypoint-initdb.d — so the votes / votes_latest_unique schema + on_vote_insert_update_unique_table rule are present (equivalent to an explicit migration-apply step). Also copy delphi/scripts into the container so tests/test_generator_vote_copy.py can import the cold-start generator under test. With POLIS_TEST_POSTGRES_URL set, require_polis_postgres verifies the schema and yields the URL (no docker-in-docker needed); both integration tests then RUN rather than self-skip. Verified locally against a shared migrated postgres via POLIS_TEST_POSTGRES_URL: tests/poller/test_integration_postgres.py ... PASSED tests/test_generator_vote_copy.py ... PASSED (2 passed in 0.84s) commit-id:62486a46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make the opt-in Postgres integration tests actually execute in CI, and share
the provisioning path.
shared require_polis_postgres() helper (introduced in the T2 commit) instead
of its own inline throwaway-docker fixture on fixed port 5435. It now applies
000000 + 000006 and uses an ephemeral port (xdist-safe), or the CI service.
postgresservice (docker-compose.test.yml), whose image already bakes thepolis migrations via docker-entrypoint-initdb.d — so the votes /
votes_latest_unique schema + on_vote_insert_update_unique_table rule are
present (equivalent to an explicit migration-apply step). Also copy
delphi/scripts into the container so tests/test_generator_vote_copy.py can
import the cold-start generator under test.
With POLIS_TEST_POSTGRES_URL set, require_polis_postgres verifies the schema and
yields the URL (no docker-in-docker needed); both integration tests then RUN
rather than self-skip.
Verified locally against a shared migrated postgres via POLIS_TEST_POSTGRES_URL:
tests/poller/test_integration_postgres.py ... PASSED
tests/test_generator_vote_copy.py ... PASSED (2 passed in 0.84s)
commit-id:62486a46
Stack: