veza/loadtests
senke 25a7273c34 chore(cleanup): remove orphan code + archive disabled workflows + .playwright-mcp
Triple cleanup, landed together because they share the same cleanup
branch intent and touch non-overlapping trees.

1. 38× tracked .playwright-mcp/*.yml stage-deleted
   MCP session recordings that had been inadvertently committed.
   .gitignore already covers .playwright-mcp/ (post-audit J2 block
   added in 98ee449f4). Working tree copies removed separately.

2. 19× disabled CI workflows moved to docs/archive/workflows/
   Legacy .yml.disabled files in .github/workflows/ were 1676 LOC of
   dead config (backend-ci, cd, staging-validation, accessibility,
   chromatic, visual-regression, storybook-audit, contract-testing,
   zap-dast, container-scan, semgrep, sast, mutation-testing,
   rust-mutation, load-test-nightly, flaky-report, openapi-lint,
   commitlint, performance). Preserved in docs/archive/workflows/
   for historical reference; `.github/workflows/` now only lists the
   5 actually-running pipelines.

3. Orphan code removed (0 consumers confirmed via grep)
   - veza-backend-api/internal/repository/user_repository.go
     In-memory UserRepository mock, never imported anywhere.
   - proto/chat/chat.proto
     Chat server Rust deleted 2026-02-22 (commit 05d02386d); proto
     file was orphan spec. Chat lives 100% in Go backend now.
   - veza-common/src/types/chat.rs (Conversation, Message, MessageType,
     Attachment, Reaction)
   - veza-common/src/types/websocket.rs (WebSocketMessage,
     PresenceStatus, CallType — depended on chat::MessageType)
   - veza-common/src/types/mod.rs updated: removed `pub mod chat;`,
     `pub mod websocket;`, and their re-exports.
   Only `veza_common::logging` is consumed by veza-stream-server
   (verified with `grep -r "veza_common::"`). `cargo check` on
   veza-common passes post-removal.

Refs: AUDIT_REPORT.md §8.2 "Code mort / orphelin" + §9.1.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 20:33:40 +02: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
regression chore(cleanup): remove orphan code + archive disabled workflows + .playwright-mcp 2026-04-20 20:33:40 +02: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