Commit da0bdbb
ci: gate postgres-backend tests against a pgvector service container
Adds a new test-postgres job to .github/workflows/ci.yml. Runs in
parallel with the existing test-linux / test-windows / test-macos /
lint matrix; doesn't disturb their behavior.
Service container: pgvector/pgvector:pg16 (public Docker Hub image,
PG16 + pgvector pre-installed). Bound on localhost:5432 in the job
network. Pre-test setup step creates the vector extension inside
the mempalace_test database (idempotent IF NOT EXISTS).
Test scope: tests/test_backends_postgres.py only. The full pytest
suite is already exercised by test-linux without the postgres extra;
running it again with TEST_POSTGRES_DSN set would double the suite
time on every PR for the marginal coverage of three additional tests.
The targeted job gives us the regression signal we want — postgres
backend works end-to-end against a real database — without the cost.
AGE is deliberately not in the CI image. The apache/age + pgvector
combined image we deploy on the homelab (mempalace-db on disks) isn't
needed in CI yet — no test in the repo exercises AGE-specific
behavior. When the knowledge-graph layer lands and adds AGE tests,
the CI image swap is a separate concern (push our mempalace-db:0.1
image to ghcr.io/jphein, or build inline in CI). Until then,
pgvector-only is the cheapest correct substrate.
The CREATE EXTENSION step uses a Python heredoc with the DSN passed
via env var (PGURL) rather than inline psql — avoids the
postgresql-client install on the runner and removes one shell-quoting
surface.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 1d5486f commit da0bdbb
1 file changed
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
0 commit comments