Status: Accepted
Date: 2026-05-10 UTC
Epic: #1556 — Raptor SQLite → Postgres migration
Design doc: docs/architecture/raptor-postgres-migration/design.md §5
Raptor's existing test suite uses SQLite in-memory or file fixtures. After the Postgres migration, tests must be runnable against Postgres in CI without requiring a running Postgres service on the developer's machine (local dev keeps the SQLite fallback). Three options were evaluated.
Use pytest-postgresql>=5.0 for Postgres test fixtures in CI. Maintain the
existing SQLite fixture path for local dev (no DATABASE_URL set).
Positive:
pytest-postgresql uses pg_ctl to spin up a temporary Postgres process
per test session. No Docker daemon required.ubuntu-latest ships with PostgreSQL; pg_ctl is available
after a one-line apt-get install postgresql CI step. No Docker-in-Docker.conftest.py works for both dialects: detect DATABASE_URL; if
absent, SQLite; if Postgres URL, use the pytest-postgresql process fixture.
Test bodies do not change — the abstraction is at the fixture level.pytest against
SQLite. Zero friction for the common case.pytest-postgresql) to dev dependencies. Lightweight.Negative:
postgresql installed on the CI runner. This is a one-line CI step
but adds ~10–15 s to CI setup time.pg_ctl fixture approach is less hermetic than a Docker container — the
Postgres binary version is whatever ubuntu-latest ships. This is acceptable
for v1; if we later need a specific Postgres version, testcontainers becomes
relevant.docker as a dev dependency for local testing. Not zero-friction.? → :param migration and type mapping errors
would only surface in staging.webauthn_service.py. A Postgres CI run is
the primary safety net.