From 314a977cedd572e3d43a8ad8b1609350f25b89ae Mon Sep 17 00:00:00 2001 From: myrmidex Date: Sun, 28 Jun 2026 18:04:19 +0200 Subject: [PATCH] 52 - Add dev-e2e and dev-check shell helpers --- shell.nix | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/shell.nix b/shell.nix index ccfc7d2..9d7268b 100644 --- a/shell.nix +++ b/shell.nix @@ -155,6 +155,44 @@ pkgs.mkShell { $COMPOSE exec frontend npm run build "$@" } + dev-e2e() { + # Run the Playwright e2e smoke suite in the `playwright` compose service + # (browsers preinstalled). Needs the stack up (dev-up). NOT the Vitest + # suite — that's dev-fe-test. Pass-through args, e.g.: dev-e2e --headed + PODMAN_USERNS=keep-id $COMPOSE --profile e2e run --rm playwright npm test -- "$@" + } + + dev-check() { + # Fast pre-commit gate: all static/unit checks, back + front. Fail-fast + # (stops at the first failure). No coverage, no e2e — use dev-check-all + # for the thorough version. + echo "▶ backend: tests" && dev-test \ + && echo "▶ backend: phpstan" && dev-stan \ + && echo "▶ backend: cs" && dev-cs \ + && echo "▶ frontend: tests" && dev-fe-test \ + && echo "▶ frontend: lint" && dev-fe-lint \ + && echo "▶ frontend: cs" && dev-fe-cs \ + && echo "▶ frontend: build" && dev-fe-build \ + && echo "✓ dev-check passed" + } + + dev-check-all() { + # Thorough gate: everything in dev-check, but with COVERAGE instead of the + # plain test runs, plus the Playwright e2e. Slow; needs the stack up. + # NOTE: frontend coverage (dev-fe-coverage) is not wired yet — added in #62 + # alongside the @vitest/coverage-v8 setup; until then this runs the plain + # frontend test suite for the frontend leg. + echo "▶ backend: coverage" && dev-coverage \ + && echo "▶ backend: phpstan" && dev-stan \ + && echo "▶ backend: cs" && dev-cs \ + && echo "▶ frontend: tests (coverage pending #62)" && dev-fe-test \ + && echo "▶ frontend: lint" && dev-fe-lint \ + && echo "▶ frontend: cs" && dev-fe-cs \ + && echo "▶ frontend: build" && dev-fe-build \ + && echo "▶ e2e" && dev-e2e \ + && echo "✓ dev-check-all passed" + } + # =================== # DATABASE / MIGRATION COMMANDS # =================== @@ -253,6 +291,9 @@ pkgs.mkShell { echo " dev-fe-cs [args] Check frontend formatting (Prettier)" echo " dev-fe-cs-fix Apply frontend formatting" echo " dev-fe-build Build the frontend (tsc + vite build)" + echo " dev-e2e [args] Run Playwright e2e smoke suite (container)" + echo " dev-check Fast gate: all back+front tests/stan/cs/build" + echo " dev-check-all Thorough gate: dev-check + coverage + e2e" echo " dev-migrate-diff Generate a migration from entity mappings" echo " dev-migrate Apply migrations to dev + test DBs" echo " dev-migrate-prev Roll back one migration on dev + test DBs"