ci: run the database tests against postgres #277

Sammanfogat
supernaut sammanfogade 2 incheckningar från ci/postgres-tests in i main 2026-10-02 20:50:46 +00:00
Ägare

What

Run the database-backed tests in CI. scripts/purge-expired.db.test.mjs (GDPR purge, #275) skipped there because CI had no Postgres.

  • A "Start Postgres" step runs postgres:17 with podman run -p 5432:5432 and waits on pg_isready. It is a step, not services:: the ci runner is a host executor and never starts service containers.
  • An "Apply migrations" step runs node scripts/migrate.mjs. DATABASE_URL is set on that step only, so build and e2e still run without a database.
  • TEST_DATABASE_URL is set for the job. The DB test file now throws when CI is set without it, so it can never skip silently again.

Verification

Local, postgres:17 with migrations applied, CI=true and TEST_DATABASE_URL set: 35/35 files, 492/492 tests, 0 skipped. CI=true without the variable: the DB test file fails. This PR's own CI run proves the step on the runner.

## What Run the database-backed tests in CI. `scripts/purge-expired.db.test.mjs` (GDPR purge, #275) skipped there because CI had no Postgres. - A "Start Postgres" step runs `postgres:17` with `podman run -p 5432:5432` and waits on `pg_isready`. It is a step, not `services:`: the `ci` runner is a host executor and never starts service containers. - An "Apply migrations" step runs `node scripts/migrate.mjs`. `DATABASE_URL` is set on that step only, so build and e2e still run without a database. - `TEST_DATABASE_URL` is set for the job. The DB test file now throws when `CI` is set without it, so it can never skip silently again. ## Verification Local, postgres:17 with migrations applied, `CI=true` and `TEST_DATABASE_URL` set: 35/35 files, 492/492 tests, 0 skipped. `CI=true` without the variable: the DB test file fails. This PR's own CI run proves the step on the runner.
supernaut lade till 2 incheckningar 2026-10-02 20:48:09 +00:00
supernaut sammanfogade incheckning bd529e6b98 till main 2026-10-02 20:50:46 +00:00
supernaut tog bort grenen ci/postgres-tests 2026-10-02 20:50:46 +00:00
supernaut refererade denna ändringsförfrågan från en incheckning 2026-10-02 20:50:46 +00:00
Logga in för att delta i denna konversation.
Inga granskare
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-web!277
Ingen beskrivning angiven.