veza/loadtests
senke b250afa8bf feat(v0.14.0): validation runtime & staging pipeline
- TASK-STAG-001: staging-validation.yml workflow (deploy + all checks)
- TASK-STAG-002: k6 staging performance validation (p95<100ms, stream<500ms)
- TASK-STAG-003: Lighthouse CI config (perf>=85, a11y>=90, CWV thresholds)
- TASK-STAG-004: staging-stability-check.sh (5xx rate monitoring)
- TASK-STAG-005: GDPR E2E integration test (export + deletion + anonymization)
- TASK-STAG-006: bundle size check integrated in validation pipeline

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 16:09:43 +01:00
..
backend feat(v0.12.4): k6 load test for 1000 concurrent users 2026-03-11 09:58:06 +01:00
chat fix(release): v1.0.2 — Conformité complète V1_SIGNOFF (21 critères) 2026-03-03 21:18:53 +01:00
staging feat(v0.14.0): validation runtime & staging pipeline 2026-03-13 16:09:43 +01:00
stream chore: consolidate CI, E2E, backend and frontend updates 2026-02-17 16:43:21 +01:00
config.js fix(release): v1.0.2 — Conformité complète V1_SIGNOFF (21 critères) 2026-03-03 21:18:53 +01:00
README.md chore(release): v0.951 — Loadtest (500 req/s, 1000 WS, 50 uploads, perf indexes) 2026-03-02 19:22:38 +01:00
smoke.js feat(loadtests): audit 3.2 — tests de charge k6 complets 2026-02-15 15:22:48 +01:00

Load Tests (k6)

Tests de charge pour la plateforme Veza. Audit 3.2.

Prérequis

  • k6 installé (brew install k6 ou sudo apt install k6)

Variables d'environnement

Variable Défaut Description
BASE_URL http://localhost:8080 URL de l'API backend
API_ORIGIN idem Alias pour BASE_URL
STREAM_ORIGIN http://localhost:8082 URL du stream server
CHAT_ORIGIN ws://localhost:8081 URL WebSocket du chat server
AUTH_TOKEN (vide) JWT pour tests upload (optionnel)

Exécution locale

Smoke test (validation rapide, ~30s)

k6 run loadtests/smoke.js

Backend API

# Health, readyz, status
k6 run loadtests/backend/health.js

# Auth (register, login, /me, refresh)
k6 run loadtests/backend/auth.js

# Tracks (liste, search, détail)
k6 run loadtests/backend/tracks.js

# Uploads (AUTH_TOKEN optionnel — setup crée des users si absent)
AUTH_TOKEN=xxx k6 run loadtests/backend/uploads.js
# v0.951: 50 uploads concurrents pendant 2 min
k6 run loadtests/backend/uploads.js

# Playlists
k6 run loadtests/backend/playlists.js

# Marketplace
k6 run loadtests/backend/marketplace.js

# Scénario combiné (health, auth, tracks, playlists, marketplace)
k6 run loadtests/backend/full.js

# Stress test 500 req/s (v0.951) — login, tracks, search, products
# Seuils: P99 < 500ms, 500 VUs ramp 0→100→250→500 sur 3 min, maintien 2 min
k6 run loadtests/backend/stress_500rps.js
# Avec rapport JSON:
k6 run --out json=report.json loadtests/backend/stress_500rps.js

Stream server

# Health, healthz, readyz (stream server doit tourner)
k6 run loadtests/stream/http.js

Chat WebSocket

# Backend API + Chat server requis
k6 run loadtests/chat/websocket.js

# Stress test 1000 WebSocket concurrent (v0.951)
# Prérequis: Backend + Chat server, mémoire serveur < 2GB
k6 run loadtests/chat/stress_1000ws.js

Docker

docker run --rm -i --network=host \
  -v $(pwd)/loadtests:/scripts \
  -e BASE_URL=http://localhost:8080 \
  grafana/k6 run /scripts/smoke.js

CI

Le workflow .github/workflows/load-test-nightly.yml s'exécute :

  • Schedule : 2h UTC chaque nuit
  • Manual : workflow_dispatch

Il lance smoke + backend full, puis uploade les résultats en artifact.

Structure

loadtests/
├── README.md
├── config.js
├── smoke.js
├── backend/
│   ├── health.js
│   ├── auth.js
│   ├── tracks.js
│   ├── uploads.js
│   ├── playlists.js
│   ├── marketplace.js
│   ├── full.js
│   └── stress_500rps.js
├── stream/
│   └── http.js
└── chat/
    ├── websocket.js
    └── stress_1000ws.js