Local dev and the test suite previously defaulted to the live production Neon database, and running the tests mutated prod data. Add guardrails plus a proper local Postgres + migrations workflow so production can't be hit by mistake: - docker-compose: local Postgres 17 (matches prod) + auto-created teqo_test - dev guard refuses a non-local DATABASE_URL; tests refuse non-_test databases - .env.test isolates the suite; vitest/playwright load it and fail closed - Payload migrations set up (push disabled); build runs `payload migrate`, so deploys apply pending migrations to prod automatically - baseline `initial` migration + idempotent consent.text varchar->jsonb fix - `pnpm db:pull` copies prod content locally, excluding supporter PII - docs (README, AGENTS.md) + agent skills for the local-db/migration workflow
13 lines
694 B
Text
13 lines
694 B
Text
# Environment for the automated test suite (vitest + playwright).
|
|
#
|
|
# This file is committed ON PURPOSE: it contains no secrets, only local values.
|
|
# The test suite deletes and recreates records, so it MUST use an isolated,
|
|
# throwaway database. Tests load THIS file (not .env / .env.local) and refuse to
|
|
# run unless the database name ends with "_test" (see assertTestDatabase.ts).
|
|
#
|
|
# Requires the local Postgres from docker-compose (`pnpm db:start`), which
|
|
# auto-creates the teqo_test database on first run.
|
|
DATABASE_URL=postgresql://teqo:teqo@localhost:5432/teqo_test
|
|
PAYLOAD_SECRET=test-only-secret-not-used-in-production
|
|
BLOB_READ_WRITE_TOKEN=
|
|
NEXT_PUBLIC_SITE_URL=http://localhost:3000
|