b3ffb2d4b6
Two-step email + one-time-code sign-in behind both doors; pure entry-routing rule unit- tested with Vitest (§6.8); storefront routing reaches a SLICE-2 signed-in placeholder with sign-out (PUC-9). check.sh now runs the frontend unit tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
41 lines
1.4 KiB
Bash
Executable File
41 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# The single pre-merge gate for wiggleverse-ecomm (SD-0001 §6.8). Runs, in order:
|
|
# 1. the import-linter layering contract (main > domains > platform)
|
|
# 2. the backend test suite (pytest, against Postgres)
|
|
# 3. the frontend typecheck + production build
|
|
# CI (.gitea/workflows/ci.yml) calls this exact script, so local and server gates
|
|
# cannot drift. Exits non-zero on the first failure.
|
|
#
|
|
# Requires a reachable Postgres for the backend tests: locally the compose service
|
|
# (scripts/dev.sh brings it up); in CI a Postgres service container. Override its
|
|
# admin DSN with ECOMM_TEST_ADMIN_URL.
|
|
set -euo pipefail
|
|
|
|
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
|
|
# Pick an interpreter: explicit $PYTHON (CI), else the repo venv, else PATH.
|
|
if [ -n "${PYTHON:-}" ]; then
|
|
PY="$PYTHON"
|
|
elif [ -x "$repo_root/.venv/bin/python" ]; then
|
|
PY="$repo_root/.venv/bin/python"
|
|
else
|
|
PY="$(command -v python3 || command -v python)"
|
|
fi
|
|
|
|
lint="$(dirname "$PY")/lint-imports"
|
|
[ -x "$lint" ] || lint="lint-imports"
|
|
|
|
echo "==> import boundaries (lint-imports)"
|
|
( cd "$repo_root/backend" && "$lint" )
|
|
|
|
echo "==> backend tests (pytest)"
|
|
( cd "$repo_root/backend" && "$PY" -m pytest -q )
|
|
|
|
echo "==> frontend typecheck + build"
|
|
( cd "$repo_root/frontend" && npm run build )
|
|
|
|
echo "==> frontend unit tests (vitest)"
|
|
( cd "$repo_root/frontend" && npm test )
|
|
|
|
echo "==> all gates green"
|