E2E Backend Setup - nself-org/nchat GitHub Wiki
E2E Backend Setup
This page documents how the E2E CI workflow provisions the nself backend stack for Playwright tests.
Overview
The three-shard e2e-web job provisions the nself backend on each ephemeral GitHub
Actions runner before running the Playwright test slice. Because GHA jobs run on
isolated runners, the backend must be started WITHIN the same job that runs the tests.
Backend port map
The nself default port assignments used in E2E:
| Service | Port | Health endpoint |
|---|---|---|
| Hasura GraphQL | 8080 | http://localhost:8080/healthz |
| Nhost Auth | 4000 | http://localhost:4000/healthz |
| MinIO (S3) | 9000 | — |
| Postgres | 5432 | — (internal only) |
| Redis | 6379 | — (internal only) |
| Nginx (SSL terminator) | 443/80 | — (not used in CI; tests use direct ports) |
These ports are the nself standard defaults; they are not changed by nchat. No new ports
are introduced by tracking backend/docker-compose.yml.
backend/docker-compose.yml in git
backend/docker-compose.yml is tracked in this repo as a CI exception to the standard
"generated files are gitignored" rule. The nself CLI's nself start --skip-build command
requires the compose file to be present at checkout. Tracking it allows CI to use the
pre-generated stack definition without running nself build (which requires a plugin
license key).
The file is regenerated locally by nself build on every developer machine; CI uses
the committed version. The backend/.gitignore exception is:
docker-compose.*.yml
!docker-compose.yml
Provisioning steps in CI
- Install nself CLI binary from GitHub release
- Create
backend/.envby copyingbackend/.env.dev(the nself CLI detects a project via the presence of a bare.envfile) - Create build-state marker so
--skip-buildskips the legacy artifact check - Run
nself start --skip-build --allow-legacy --quiet - Wait for Hasura health (up to 120 s)
- Wait for Auth health (up to 120 s)
- Seed E2E test users via the Auth API
Test users
All test users use password password123 and are seeded before tests run:
| Role | |
|---|---|
| [email protected] | owner |
| [email protected] | admin |
| [email protected] | moderator |
| [email protected] | member |
| [email protected] | guest |
Seeding is idempotent — HTTP 409/422 (already exists) is treated as success.