test(supabase): avatar suite on the sandbox, per-run sandbox passwords

pnpm db:sandbox avatar-e2e runs tests/e2e/avatar-flow.e2e.ts with the real
worker (default mode) on the throwaway stack; the suite now requires its
database container by name, makes both accounts per run and expedites only
its own purges. Throwaway sandbox accounts get random passwords per run.
This commit is contained in:
bchanot committed 2026-11-01 21:02:59 +01:00
1 parent 96b19e5a87
commit 2a84e3702e
8 files changed
+139 -79

No files matched your search

+1 -1
View File
@@ -102,7 +102,7 @@ Chromium (Playwright prints the install command), a stale core module
`pnpm check:all` runs `pnpm e2e:ui` when the pinned Chromium is installed;
otherwise it prints `SKIPPED` with the reason and the install command, and
goes on. `pnpm e2e:shell` needs the sandbox and stays a separate run, like
`pnpm e2e:avatar`. The last lines of a green run state each browser suite:
`pnpm db:sandbox avatar-e2e`. The last lines of a green run state each browser suite:
`PASSED`, `SKIPPED` (environment missing, with the reason) or `NOT RUN`
(`e2e:shell`). A suite that runs and fails stops `check:all` with
`== FAILED: <stage>` and a non-zero exit, never a warning. Both suites keep
+3 -1
View File
@@ -167,7 +167,8 @@ User files land in private buckets and are processed by the Rust worker
```bash
pnpm worker:image # faunosteo_worker:dev
pnpm e2e:avatar # starts the container on supabase_network_faunosteo, runs tests/e2e, stops it
pnpm e2e:avatar # starts the container on supabase_network_faunosteo, runs tests/e2e, stops it (DEV: the owner's call)
pnpm db:sandbox avatar-e2e # the same suite and worker image on the throwaway stack (§5.1), the check of a storage or worker change
docker compose --profile worker up worker # the same container from docker-compose.yml, reading .env.worker
```
@@ -801,6 +802,7 @@ Docker.
| `pnpm db:sandbox test` | `packages/supabase/tests/sandbox/*.sandbox.ts`: real GoTrue, PostgREST and Storage sessions, concurrent SQL sessions (two-session lock order, V1-2.1), timing at the caps, the PGlite shim against the image; re-runnable on one stack |
| `pnpm db:sandbox e2e-shell` (= `pnpm e2e:shell`) | the authenticated `/app` shell in Chromium (`apps/app/e2e/shell`, `docs/development/BROWSER_TESTS.md`): a loopback dev server whose Supabase calls are replayed on the sandbox, fictitious accounts per test |
| `pnpm db:sandbox verify-e2e` | V1-2.3: a gateway (`nginx:1.31-alpine`, sandbox network only, no host port) and the real verification worker `faunosteo_worker:dev run --jobs sheet-verify` against the sandbox, then `packages/supabase/tests/sandbox/sheet-verification.sandbox.ts`; both containers removed at the end, the service key passed through a 600 file deleted at start |
| `pnpm db:sandbox avatar-e2e` | V1-2.3: the same gateway, published on `127.0.0.1:57800` only and routing `/auth/v1/` too, the real worker `faunosteo_worker:dev run` (default mode: avatars and sweep, 5 s sweep, no quarantine grace, 512 MiB as the compose `worker`) against the sandbox, then `packages/supabase/tests/e2e/avatar-flow.e2e.ts` through that port; the suite's psql calls go to the sandbox database container, which it requires by name; its two accounts are made per run with random passwords and deleted after; both containers removed at the end |
| `pnpm db:sandbox sql` / `down` | psql as postgres on stdin / remove the stack |
Every CLI call passes `--db-url` with `sslmode=disable` (the sandbox has no