Skip to content

E2E Testy

Sentinel provozuje e2e test suite proti hub-alfa (staging). Testy běží na Sentinelu, nezávisle na dev.

Spouštění

cd /root/projects/sentinel/tests

./run.sh                           # smoke, všechny služby
./run.sh standard                  # standard scope
./run.sh full                      # full e2e
./run.sh smoke --service=auth      # jen auth
./run.sh full --service=pulse      # full jen pro pulse

Scopy

Scope Počet testů Čas Kdy spouštět
smoke ~11 ~1s Po každém deployi
standard ~24 ~2s Po minor releasu
full ~33 ~3s Po major releasu, na vyžádání

Přehled testů podle služby

S60Auth

Test Scope Popis
Health check smoke GET /api/health → 200
Container running smoke s60-auth-backend + s60-auth-frontend Up
SSL cert validity smoke auth.s60hub.cz cert expiry > 7 dní
/api/health JSON standard Validní JSON response
/api/version standard 200 + validní JSON
Login bad credentials standard POST /api/auth/login → 401 (ne 500)
Google OAuth redirect full GET /api/auth/oauth/google/authorize → 302 na google.com

S60 Pulse

Test Scope Popis
Health check smoke GET / → 200 nebo 302
Container running smoke s60-pulse Up
SSL cert validity smoke pulse.s60hub.cz cert expiry > 7 dní
/admin accessible standard GET /admin → 200/301
/app accessible standard GET /app → 200/301
/api/methodologies standard 200 + validní JSON
/api/clients full JSON response (skip pokud 401/403)
/api/outputs full JSON response (skip pokud 401/403)
/api/pricing/tiers full JSON response (skip pokud 401/403)

S60Mail

Test Scope Popis
Health check smoke GET /health → 200
Health body smoke Response obsahuje {"status":"ok"}
Container running smoke s60-mail Up
/health JSON standard Validní JSON
/queues (Bull Board) standard 200/301/302
/api/templates standard 200 + validní JSON
Template CRUD full POST vytvoří template (201), DELETE smaže

Cross-service

Test Scope Popis
Redis PING smoke redis-cli -a ... ping → PONG přes SSH
Redis connectivity full Redis + všechny health endpointy
DB connectivity full Všechny služby healthy (implicitně DB)

Doporučení pro deploy

Typ releasu db_change Doporučený scope
Hotfix / config change none smoke
Minor (nové endpointy, UI změny) none/minor standard
Major (nové DB tabulky, breaking changes) minor/major full

Výstup

Barevný terminal output s PASS/FAIL/SKIP per test. Exit code 0 = vše prošlo, 1 = něco failovalo.

Soubory

/root/projects/sentinel/tests/
├── run.sh          # hlavní runner + helper funkce
├── smoke.sh        # health, redis, containers, SSL
├── standard.sh     # API endpoint validace
└── full.sh         # OAuth, CRUD, cross-service