From d7845b7339332d9c69f1cd2759b7dfcc7c53283f Mon Sep 17 00:00:00 2001 From: bchanot Date: Mon, 26 Oct 2026 01:02:54 +0100 Subject: [PATCH] chore(ci): check:all names each browser suite PASSED, SKIPPED or NOT RUN A failing stage prints FAILED with its name and exits non-zero; e2e:shell is reported NOT RUN (it needs the isolated stack); both suites keep their own commands. --- docs/development/BROWSER_TESTS.md | 19 +++++++++++++------ scripts/check-all.sh | 12 ++++++++++-- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/docs/development/BROWSER_TESTS.md b/docs/development/BROWSER_TESTS.md index cc2d4dc3..708e742e 100644 --- a/docs/development/BROWSER_TESTS.md +++ b/docs/development/BROWSER_TESTS.md @@ -59,11 +59,14 @@ object with the service key). `pnpm db:sandbox down` removes all of it. - axe (`@axe-core/playwright` 4.14.0, rules tagged WCAG 2.0 to 2.2 A and AA plus best practices): zero serious or critical violation on each scanned state, colours measured once animations have settled. Three pre-existing - findings, outside the V1-1.3 code, are let through by exact node and listed - with their reason in `KNOWN_VIOLATIONS` and in TODO RR-7: the language - switcher's names (« FR » shown, « Passer en français » announced), the top - bar account link (display name shown, « Mon compte » announced), the - dashboard's `dl` holding a status row without `dt`/`dd`. + findings, outside the V1-1.3 code, are listed with their reason in + `KNOWN_VIOLATIONS` and in TODO RR-7: the language switcher's names (« FR » + shown, « Passer en français » announced), the top bar account link (display + name shown, « Mon compte » announced), the dashboard's `dl` holding a status + row without `dt`/`dd`. Each entry names the axe rule, the selector, the + opening markup of the element and the route where it lives; a node is let + through only when all four match, so a new screen or a new element never + inherits an exception (owner brief 2026-10-26). - Reports: `apps/app/e2e/test-results/` and `apps/app/e2e/playwright-report/`, git-ignored. The UI suite keeps a trace and a screenshot of a failed test (no backend, no secret). The shell suite keeps a screenshot only: a trace @@ -85,7 +88,11 @@ 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`. A CI runner installs the same Chromium +`pnpm e2e:avatar`. 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: ` and a non-zero exit, never a warning. Both suites keep +their own commands and run alone. A CI runner installs the same Chromium (`playwright install chromium` in its image) and runs `pnpm e2e:ui`; the shell suite needs Docker in the runner for the sandbox. diff --git a/scripts/check-all.sh b/scripts/check-all.sh index cf052cf3..edba7074 100755 --- a/scripts/check-all.sh +++ b/scripts/check-all.sh @@ -7,14 +7,18 @@ # `pnpm db:test` is the real-stack complement after a change under supabase/. The browser # suite runs when the Chromium of the pinned Playwright is installed, else it is reported # SKIPPED with the reason (docs/development/BROWSER_TESTS.md); `pnpm e2e:shell` needs the -# isolated stack and stays a separate run. +# isolated stack and stays a separate run, reported NOT RUN. The last lines state each +# browser suite: PASSED, SKIPPED (environment missing) or NOT RUN; a failure is FAILED. set -euo pipefail cd "$(dirname "$0")/.." stage() { + current_stage="$1" printf '\n== %s (%s)\n' "$1" "$(date +%H:%M:%S)" } +# A failing stage stops the run and is named as FAILED, never turned into a warning. +trap 'echo "== FAILED: $current_stage" >&2' ERR stage "rust: fmt, clippy, tests, ts-rs export, cargo-deny (native toolchain)" bash scripts/rust-check.sh @@ -38,8 +42,10 @@ stage "browser: Chromium UI suite (pnpm e2e:ui), desktop and 375 px, axe" chromium="$(cd apps/app && node -e "console.log(require('@playwright/test').chromium.executablePath())")" if [ -x "$chromium" ]; then pnpm e2e:ui + browser_ui="PASSED" else - echo "== SKIPPED: no Chromium for the pinned Playwright at $chromium" + browser_ui="SKIPPED: no Chromium for the pinned Playwright at $chromium" + echo "== $browser_ui" echo " install it without sudo: pnpm --filter @faunosteo/app exec playwright install chromium" fi stage "docker: application image" @@ -51,3 +57,5 @@ pnpm worker:image docker run --rm --read-only --cap-drop ALL --security-opt no-new-privileges:true \ faunosteo_worker:dev run --check stage "all checks passed" +echo " browser e2e:ui $browser_ui" +echo " browser e2e:shell NOT RUN by check:all: it needs the isolated stack (pnpm db:sandbox up fresh, then pnpm e2e:shell)"