ci: run DB-backed tests against a Postgres service - #22
Merged
Conversation
handle.test.ts's 11 cases skipped in CI because no Postgres was reachable. Add a postgis/postgis:16-3.4 service container to the build job with a pg_isready health check, and point OSDS_TEST_DATABASE_URL at its maintenance database so the suite creates its per-run scratch DB there instead of skipping. Unchanged: trigger stays `pull_request` (never pull_request_target), `permissions: contents: read`. Verified locally by running `pnpm test` with OSDS_TEST_DATABASE_URL=postgresql://osds:...@localhost:5432/postgres - 168 passed, 0 skipped, no leftover scratch databases. Closes #18 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Puf9jhj137U3iswf4GWZkG Signed-off-by: Matthew Wren <info@origindev.com>
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.
Closes #18
handle.test.ts's 11 cases skip in CI because there's no Postgres to connect to.Change (
.github/workflows/ci.ymlonly)postgis/postgis:16-3.4service container to thebuildjob with apg_isready -U osdshealth check (5s interval, 10 retries).OSDS_TEST_DATABASE_URL=postgresql://osds:osds@localhost:5432/postgreson thepnpm teststep. The DB-backed suite connects there, creates a uniquely-named scratch database, runs the@osds/dbmigrations against it, and drops it afterward.Unchanged, deliberately
pull_request— notpull_request_target.permissions: contents: read— untouched.Verification
actisn't available locally, so I ran the exact mechanism the CI step uses:No leftover scratch databases. This PR's own CI run is the CI-side confirmation.
🤖 Generated with Claude Code