Environment setup and E2E tests
This guide explains how to set up dev, test, qa, and prod environments and how to run end-to-end (E2E) tests against them. It is for system administrators who deploy Rediflow and for developers who verify deployments.
Environments overview
| Environment | APP_ENV | Config | Use case |
|---|---|---|---|
| dev | dev |
.env.dev |
Local development |
| test | test |
.env.test |
Automated tests (unit, integration, E2E) |
| qa | qa |
.env.qa |
QA / staging before production |
| prod | prod |
.env.prod |
Production |
Each environment uses its own .env file and, when using containers, its own compose profile or file. See Configuration for load order and variable reference.
Prerequisites
- Podman (or Docker) with
podman compose - PostgreSQL 18+ — always containerised; no SQLite
- uv — for running Python scripts (or equivalent)
Dev environment
For local development:
-
Copy
.env.dev.exampleto.env.devand setDATABASE_URL,SECRET_KEY. -
Start the database and app:
make up-db make migrate make upOr with Podman:
podman compose --profile dev up -d -
Open http://localhost:5000
See Podman install and Configuration for details.
Test environment
The test environment is used for automated unit, integration, and E2E tests. It runs on port 5002 and can include Authentik for identity tests.
-
Copy
.env.test.exampleto.env.testand setDATABASE_URL(e.g.postgresql://rediflow:rediflow@localhost:15433/rediflow),SECRET_KEY, and optionallyAUTHENTIK_BOOTSTRAP_TOKEN. -
Ensure
docs/example.odsexists (required for seed). -
Run the full test suite:
make test-e2e-test
This target:
- Starts db, redis, and optionally Authentik
- Runs migrations and RLS setup
- Seeds the Example project
- Runs unit and integration tests
- Starts the app (container or local fallback)
- Runs E2E browser tests (Playwright)
Prerequisites for make test-e2e-test: .env.test, docs/example.ods, podman compose. Optional: ts (from moreutils) for timestamped logs when redirecting output.
E2E against an already-running app: If the app is already running (e.g. on port 5002), set LIVE_URL=http://localhost:5002 and run:
make test-e2e
QA environment
For QA or staging before production:
-
Copy
.env.qa.exampleto.env.qaand setPOSTGRES_PASSWORD,SECRET_KEY, and any OIDC variables. -
Start the stack:
podman compose -f compose.deploy-qa.yml up -d -
Run migrations:
podman compose -f compose.deploy-qa.yml run --rm app-qa rediflow migrate head -
(Optional) Seed calendars and projects. See Seed projects and calendars.
App at http://localhost:5001.
Running E2E against QA: Set LIVE_URL=http://localhost:5001 and run make test-e2e (or uv run pytest tests/e2e -v -m e2e). Ensure the app is healthy and reachable first; see QA verification.
Production environment
For production:
-
Copy
.env.prod.exampleto.env.prodand set strongPOSTGRES_PASSWORD,SECRET_KEY, and any OIDC variables. -
Start the stack:
podman compose -f compose.deploy-prod.yml up -d -
Run migrations:
podman compose -f compose.deploy-prod.yml run --rm app-prod rediflow migrate head -
(Optional) Seed calendars and projects. See Seed projects and calendars.
App at http://localhost:5000.
E2E on production: Generally not recommended. Use QA for pre-release verification. If you must run E2E against prod, set LIVE_URL to your prod URL and run make test-e2e — ensure tests are read-only or use a dedicated test project.
E2E test summary
| Command | When to use |
|---|---|
make test-e2e-test |
Full automated run: starts test stack, seeds, runs unit + integration + E2E |
make test-e2e |
E2E only; app must already be running; set LIVE_URL to app URL |
E2E tests require a running app with seeded data (e.g. Example project). Tests are skipped if LIVE_URL is not set or the app is not reachable.
See also
- Deploy QA and production — Full deployment guide with container image
- QA verification — Verify deployment health before handover
- Configuration — Environment variables and load order
- Authentik setup — OIDC and test environment with Authentik
- Seed testing data — Populate test data for development