test: add PostgreSQL migration integration coverage
CI / verify (pull_request) Successful in 19s
CI / infrastructure-smoke (pull_request) Successful in 21s
CI / migration-smoke (pull_request) Failing after 16s

This commit is contained in:
ekklesia
2026-07-21 09:37:15 -05:00
parent b38f85f438
commit 831a48187c
16 changed files with 1690 additions and 96 deletions
@@ -122,10 +122,14 @@ messages, machine-specific paths, causes, stacks, or partial execution results.
are reported without hiding the primary failure and without copying underlying exception text.
The developer commands read `DATABASE_URL` from the environment. A local uncommitted `.env` may
supply it, but commands never print it. This slice verifies database behavior through a narrow
in-memory database port and unit tests. A real PostgreSQL integration suite for lock contention,
DDL rollback, history creation, and driver behavior is deliberately deferred rather than claimed
by the current verification gate.
supply it, but commands never print it. This decision's implementation slice verified database
behavior through a narrow in-memory database port and unit tests; it deliberately deferred live
PostgreSQL evidence to a follow-up slice rather than claiming it at acceptance time.
Implementation follow-up (2026-07-21): `pnpm test:migrations:integration` now runs the production
adapter and migration services against disposable PostgreSQL for lock contention, DDL rollback,
history creation, approvals, and sanitized driver failures. The Docker-backed command remains
separate from the code-only `pnpm verify` gate.
The transaction and single-client choices follow node-postgres's
[transaction guidance](https://node-postgres.com/features/transactions). The non-blocking lock and
@@ -162,6 +166,6 @@ that invocation's schema or history changes committed. Destructive migrations ar
a trusted approval provider is composed, by design.
The all-or-nothing batch can hold locks for longer than per-migration transactions and excludes
operations PostgreSQL forbids in a transaction. The current unit-tested database port gives fast,
deterministic coverage but cannot prove real server behavior. The next infrastructure-focused
slice must add live PostgreSQL tests before production operation is considered complete.
operations PostgreSQL forbids in a transaction. The narrow database port continues to provide fast,
deterministic unit coverage; the dated implementation follow-up above records the separate live
PostgreSQL evidence added after this decision was accepted.