Description
No load testing exists to validate API performance under realistic traffic. Implement a k6 (or Artillery) test suite that simulates concurrent users hitting key endpoints: course listing, credential verification, enrollment, and analytics queries. Set performance budgets and run in CI on PRs.
Definition of Done
Acceptance Criteria
k6 run load-test.js executes successfully against local backend
- Smoke test runs in CI on every PR
- Performance budgets are checked and failures reported
- Test results include p50, p95, p99 latencies and error rate
- Seeded data does not persist to production database
Files to Modify
- New file:
tests/load/k6-smoke.js — smoke test (10 users, 1 min)
- New file:
tests/load/k6-full.js — full load test (100 users, 5 min)
- New file:
tests/load/seed-data.js — test data seeder
- New file:
tests/load/config.json — k6 configuration
.github/workflows/ci.yml — add load test job (smoke test)
backend/package.json — add k6 or artillery dev dependency
docker-compose.yml — may add k6 service for local testing
Description
No load testing exists to validate API performance under realistic traffic. Implement a k6 (or Artillery) test suite that simulates concurrent users hitting key endpoints: course listing, credential verification, enrollment, and analytics queries. Set performance budgets and run in CI on PRs.
Definition of Done
Acceptance Criteria
k6 run load-test.jsexecutes successfully against local backendFiles to Modify
tests/load/k6-smoke.js— smoke test (10 users, 1 min)tests/load/k6-full.js— full load test (100 users, 5 min)tests/load/seed-data.js— test data seedertests/load/config.json— k6 configuration.github/workflows/ci.yml— add load test job (smoke test)backend/package.json— add k6 or artillery dev dependencydocker-compose.yml— may add k6 service for local testing