mirror of
https://github.com/gadgethd/ukmesh.git
synced 2026-12-06 19:24:41 +00:00
The three `*.audit.test.ts` files from #195 are real PostgreSQL regressions, but each one guards itself with a `skip` when its fixture URL is absent, so a CI run without a database reported them as skipped and still exited 0. Add a `Database Audit Tests` job that starts a disposable PostgreSQL 16 service, sets `TEST_INGEST_DATABASE_URL` and `TEST_BACKFILL_DATABASE_URL`, and runs exactly the three files one at a time. Every file's TAP stream is piped through `backend/scripts/assert-audit-tests-ran.mjs`, which fails the job when any test is skipped, failed, cancelled or missing, so a dropped service or an unset variable can no longer turn the audit into a green no-op. Plain PostgreSQL is deliberate: the audit-high fixture refuses a database where the timescaledb extension is installed, because the extension's own `timescaledb_experimental.policies` view trips its stray-table guard. The job therefore exercises the plain-PostgreSQL branch of `installChunkCatalog`, which the fixture explicitly supports. The job prints the server version it reached (host/port/database only, never the fixture password) and keeps the TAP output as an artifact on failure. Depends on #195 for the test files themselves; the job fails with an explicit `::error` naming #195 while they are absent rather than passing.