# A throwaway Postgres for the end-to-end suite. # # The e2e suite used to run against the development database that # start-local.ps1 brings up, and nothing ever truncated it: every run seeded # more fixtures and left them. The unfiltered storefront grew monotonically — # 1,662 items by the time #186 was filed — until rendering it outran the # assertions' timeout. It failed locally, passed in CI where the database is # fresh, and got slowly worse, which is the combination nobody can act on. # # Deliberately a mirror of docker-compose.test.yml rather than a shared file. # The two suites must not share a database: the integration suite truncates # between tests, so running it while an e2e run is in flight would delete that # run's fixtures underneath it (#116). Different container, different port, # different credentials — so the mistake is impossible rather than discouraged. # # tmpfs, like the integration database: the data is worthless the moment the # run ends, and a container with nothing to persist starts faster and cannot # accumulate anything between runs. # # docker compose -f backend/docker-compose.e2e.yml up -d # docker compose -f backend/docker-compose.e2e.yml down # # The suite and the application both have to point at it. See # scripts/start-local.ps1 -E2eDb, which does that for you. services: redefined-designs-e2e-db: image: postgres:16 container_name: redefined-designs-e2e-db environment: - POSTGRES_USER=redefined_e2e - POSTGRES_PASSWORD=redefined_e2e - POSTGRES_DB=redefined_e2e ports: # Not 55432 (integration) and not 55500 (development). Override with # E2E_DB_PORT if Hyper-V has reserved this one — it silently claims # ranges on Windows, which is why the integration suite has TEST_PGPORT. - "${E2E_DB_PORT:-55501}:5432" tmpfs: - /var/lib/postgresql/data