36 lines
1.1 KiB
Text
36 lines
1.1 KiB
Text
|
|
#!/usr/bin/env sh
|
||
|
|
|
||
|
|
# ============================================================================
|
||
|
|
# Veza pre-push hook — CRITICAL E2E SMOKE
|
||
|
|
# ============================================================================
|
||
|
|
# Runs only @critical Playwright tests before push (~2-3min).
|
||
|
|
# SKIP_E2E=1 git push ... # bypass for quick iterations
|
||
|
|
# ============================================================================
|
||
|
|
|
||
|
|
set -e
|
||
|
|
|
||
|
|
REPO_ROOT="$(git rev-parse --show-toplevel)"
|
||
|
|
cd "$REPO_ROOT"
|
||
|
|
|
||
|
|
RED='\033[0;31m'
|
||
|
|
GREEN='\033[0;32m'
|
||
|
|
YELLOW='\033[1;33m'
|
||
|
|
NC='\033[0m'
|
||
|
|
|
||
|
|
if [ -n "$SKIP_E2E" ]; then
|
||
|
|
echo "${YELLOW}▶ SKIP_E2E=1 — skipping critical E2E smoke${NC}"
|
||
|
|
exit 0
|
||
|
|
fi
|
||
|
|
|
||
|
|
echo "${YELLOW}▶ Running critical E2E smoke tests (Playwright @critical)...${NC}"
|
||
|
|
echo "${YELLOW} Set SKIP_E2E=1 to bypass (not recommended for shared branches)${NC}"
|
||
|
|
|
||
|
|
npm run e2e:critical 2>&1 || {
|
||
|
|
echo "${RED}✗ Critical E2E tests failed — push blocked${NC}"
|
||
|
|
echo "${YELLOW} Tip: run 'npm run e2e:critical' locally to debug${NC}"
|
||
|
|
echo "${YELLOW} Tip: set SKIP_E2E=1 to bypass if you know what you're doing${NC}"
|
||
|
|
exit 1
|
||
|
|
}
|
||
|
|
|
||
|
|
echo "${GREEN}✓ Critical E2E smoke passed — push allowed${NC}"
|