test(supabase): avatar e2e on the sandbox only, per-session seed secret
pnpm e2e:avatar is now an alias of pnpm db:sandbox avatar-e2e and the DEV script scripts/avatar-e2e.sh is removed; the suite fails on any target but the sandbox gateway and database; an occupied port 57800 stops the run before anything starts. The sandbox replaces the seed accounts' DEV password by a per-session secret.
This commit is contained in:
1 parent
26e4b1b0ee
commit
cdd43ac431
16 files changed
+64
-100
No files matched your search
@@ -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 db:sandbox avatar-e2e`. The last lines of a green run state each browser suite:
|
||||
`pnpm e2e:avatar` (= `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
|
||||
|
||||
@@ -35,7 +35,7 @@ never hard-coded in the sources.
|
||||
|
||||
Consumers: `scripts/supabase.sh` (every CLI call: `pnpm supabase …`,
|
||||
`pnpm db:start|stop|reset|test|types`), `scripts/dev.sh` (`pnpm dev`),
|
||||
`scripts/avatar-e2e.sh`. The address changes with `FAUNOSTEO_DEV_HOST=…`
|
||||
`scripts/db-sandbox.sh`. The address changes with `FAUNOSTEO_DEV_HOST=…`
|
||||
in front of the command, without touching a source file. Calling the CLI
|
||||
binary directly (`node_modules/.bin/supabase start`) leaves the literal
|
||||
`env(...)` text in the services: always go through `pnpm`.
|
||||
|
||||
@@ -130,7 +130,7 @@ VITE_AUTH_PROVIDERS=google pnpm dev # http://<host>:5173 from any device of th
|
||||
(SUPABASE.md §8).
|
||||
10. Profile photo (Step 8, worker container running: `pnpm worker:image`
|
||||
then `docker compose --profile worker up worker` or the container of
|
||||
`scripts/avatar-e2e.sh`): Mon compte → Modifier la photo with a phone
|
||||
`pnpm e2e:avatar` on the sandbox): Mon compte → Modifier la photo with a phone
|
||||
JPEG → preview → Enregistrer → "Traitement en cours…" → the photo in the
|
||||
circle, the sidebar, the drawer (mobile) and the top bar (name beside it
|
||||
on desktop, alone on mobile) linking to Mon compte; a renamed PNG is
|
||||
|
||||
@@ -35,7 +35,7 @@ packages/supabase/
|
||||
├─ src/anatomical-sheets.ts publishSheetVersion(): the core's verdict (`sheet.check`) as gate before the RPC
|
||||
├─ src/assets.ts avatar flow: begin / quarantine upload / confirm / remove / own state / download, closed AssetFailure kinds
|
||||
├─ tests/db/ PGlite harness: runs the pgTAP files without Docker
|
||||
└─ tests/e2e/ real-stack end-to-end (avatar flow with the worker container), `pnpm e2e:avatar`
|
||||
└─ tests/e2e/ real-stack end-to-end (avatar flow with the worker container), `pnpm e2e:avatar` on the sandbox
|
||||
crates/core/src/domain/sheet/ canonical sheet document and its integrity rules (Rust core; `packages/domain` deleted at R5.7)
|
||||
```
|
||||
|
||||
@@ -167,8 +167,7 @@ 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 (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
|
||||
pnpm e2e:avatar # = pnpm db:sandbox avatar-e2e: the suite and the worker on the throwaway stack (§5.1) only
|
||||
docker compose --profile worker up worker # the same container from docker-compose.yml, reading .env.worker
|
||||
```
|
||||
|
||||
@@ -515,8 +514,9 @@ the scripts:
|
||||
on the sandbox, clean and with those conditions reproduced (scenarios and
|
||||
mutations in the journal of 2026-10-27). DEV is not validated by `db:test`
|
||||
until a run there passes.
|
||||
- `pnpm e2e:avatar`: not part of this procedure; optional, the owner's call.
|
||||
It writes on DEV beyond its own fixture: it creates a temporary confirmed
|
||||
- `pnpm e2e:avatar`: not part of this procedure. Since 2026-11-01 it runs on
|
||||
the sandbox only (owner decision; the DEV script `scripts/avatar-e2e.sh` is
|
||||
removed). Its DEV run, as recorded on 2026-10-26, wrote on DEV beyond its own fixture: it creates a temporary confirmed
|
||||
account `e2e-avatar-<time>@faunosteo.local` (and, after M1, its workspace),
|
||||
deletes it at the end (a failed run leaves it), signs in as
|
||||
`bob@faunosteo.local` (sessions and `last_sign_in_at` of an existing
|
||||
|
||||
@@ -67,7 +67,7 @@ unit suites, 2 by the browser journeys.
|
||||
| CSP on the image (R2) | the real app image behind the DEPLOY.md CSP in headless Chromium: with `'wasm-unsafe-eval'` the core runs the editor path, without it the degraded state and an untouched draft; no module request on `/login`, `/app/account`, `/` | `docker/csp-proof/app-image.sh` | before a merge touching the core loading or the image; manual (needs Chromium) |
|
||||
| Worker sandbox | integration tests against the musl binary that ships: fixture corpus through the full sandbox, refusals, SIGSYS on a denied syscall, output cap, `RLIMIT_AS` abort, `RLIMIT_CPU`, deadline; seccomp allowlist derived by `strace` and compared | `crates/worker/tests/sandbox.rs`, Dockerfile stage `test` (`pnpm worker:test`, Docker only, never native) | every `crates/worker` commit, `pnpm check:all`; CI `docker` job prepared |
|
||||
| Worker job loop | native unit tests on a fake backend and a fake decoder: call order claim → download → decode → upload → commit → purge, every child outcome mapped to a closed code, no deletion on a refused commit, lease left on transport failures, sweeper targets and acks, key validation, config and secret redaction | `crates/worker/tests/job_loop.rs`, `crates/worker/src/*` unit tests (`pnpm rust:check`) | every Rust commit |
|
||||
| Files e2e (real stack) | the worker container against the local Supabase stack: clean upload and owner-only download (Bob, anon, quarantine, direct final-key write refused), replacement and purge after the grace (queue clock shifted through psql), late signed-upload bytes swept, hostile uploads rejected with closed codes, removal and drained queue | `packages/supabase/tests/e2e/avatar-flow.e2e.ts` (`pnpm e2e:avatar`, `scripts/avatar-e2e.sh`) | every Storage, worker or avatar change; not in `check:all` (needs the stack) |
|
||||
| Files e2e (real stack) | the worker container against the throwaway sandbox stack (since 2026-11-01; DEV before): clean upload and owner-only download (Bob, anon, quarantine, direct final-key write refused), replacement and purge after the grace (queue clock shifted through psql), late signed-upload bytes swept, hostile uploads rejected with closed codes, removal and drained queue | `packages/supabase/tests/e2e/avatar-flow.e2e.ts` (`pnpm e2e:avatar` = `pnpm db:sandbox avatar-e2e`, `scripts/db-sandbox.sh`) | every Storage, worker or avatar change; not in `check:all` (needs the sandbox) |
|
||||
|
||||
Browser-only code (`svgToPng`, `DOMParser` in the importer) runs under
|
||||
happy-dom where sufficient and under Playwright when real rendering matters
|
||||
|
||||
@@ -101,7 +101,7 @@ works as `corepack pnpm <cmd>`.
|
||||
| `pnpm build` | typecheck + Vite build in every package |
|
||||
| `pnpm check` | typecheck, test:run, lint, build in sequence (the Node gate) |
|
||||
| `pnpm check:all` | the whole pre-merge gate: native Rust check, types drift, wasm build, `pnpm check`, application and worker images (`docs/development/RUST.md` §4; no CI runs it yet) |
|
||||
| `pnpm e2e:avatar` | real-stack end-to-end of the avatar flow: worker container against the local Supabase stack + `packages/supabase/tests/e2e` (`docs/development/STORAGE.md` §6; needs `pnpm db:start`) |
|
||||
| `pnpm e2e:avatar` | = `pnpm db:sandbox avatar-e2e`: real-stack end-to-end of the avatar flow, worker container + `packages/supabase/tests/e2e` on the throwaway stack only (`docs/development/STORAGE.md` §6; needs `pnpm db:sandbox up fresh` and `pnpm worker:image`) |
|
||||
| `pnpm format` | Prettier on the whole repository |
|
||||
|
||||
Package-scoped: `pnpm --filter @faunosteo/app <script>`.
|
||||
|
||||
Reference in new issue
Block a user