fix: use tmpfs for postgres data in E2E compose to prevent Flyway checksum mismatches
Some checks failed
CI / E2E browser tests (push) Has been cancelled
CI / Lint, type check, unit tests, coverage (push) Has been cancelled

The postgres:16 image declares a VOLUME for /var/lib/postgresql/data.
Docker Compose creates an anonymous volume that persists across CI runs.
When a Flyway migration file is modified, the next run sees a checksum
mismatch because the old migration is already recorded in the schema_history
table in the stale volume.

- Add tmpfs: [/var/lib/postgresql/data] to the postgres service
- This keeps data in RAM only, guaranteeing a completely fresh database
  on every E2E run with no persistent state between invocations

Result: eliminates FlywayValidateException caused by migration checksum
mismatches in CI.
This commit is contained in:
Joakim Mörling 2026-05-19 19:57:58 +02:00
parent 0f613b21a6
commit 828dd82dd3

View file

@ -12,6 +12,8 @@ services:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
networks:
- e2e
tmpfs:
- /var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s