Skip to content

feat: add k6 load/performance tests and CI workflow (#71)#85

Merged
nanaf6203-bit merged 1 commit into
StellarTips:mainfrom
MarcusDavidG:feat/k6-load-tests
Jun 20, 2026
Merged

feat: add k6 load/performance tests and CI workflow (#71)#85
nanaf6203-bit merged 1 commit into
StellarTips:mainfrom
MarcusDavidG:feat/k6-load-tests

Conversation

@MarcusDavidG

Copy link
Copy Markdown
Contributor

Summary

Closes #71

Adds k6 load/performance tests to establish API throughput baselines and catch regressions in CI.

Changes

Load Test Scripts (test/load/)

Script Endpoint Target Duration
health-smoke.js GET /health 1000 RPS 30s
profile-reads.js GET /profiles/:username 200 RPS 5 min
auth-rate-limit.js POST /auth/login 15 req/VU 2 min
tip-creation.js POST /tips 50 RPS 5 min

All scripts use check() and Trend metrics from k6, output to JSON for trend tracking, and apply ramp-up/down phases where applicable.

CI Workflow (.github/workflows/load-test.yml)

  • Uses grafana/k6-action@v0.3.1 (Docker-based k6)
  • Spins up a fresh Postgres + API stack
  • Runs all 4 scripts sequentially
  • Uploads results as k6-load-test-results artifact (retained 30 days)
  • Triggered on push to main (load test file changes) and workflow_dispatch

Documentation (docs/PERFORMANCE.md)

Documents the load envelope, thresholds, and local/CI usage instructions.

Thresholds

  • p95 response time < 200ms
  • Error rate < 1%

- Add test/load/health-smoke.js: GET /health at 1000 RPS for 30s
- Add test/load/profile-reads.js: GET /profiles/:username at 200 RPS for 5min with ramp-up/down
- Add test/load/auth-rate-limit.js: verify 10 req/min rate limit on auth endpoints
- Add test/load/tip-creation.js: burst POST /tips at 50 RPS for 5min with ramp-up/down
- Add .github/workflows/load-test.yml: CI job using grafana/k6-action with JSON artifact upload
- Add docs/PERFORMANCE.md: load envelope, thresholds, and usage documentation

Thresholds: p95 < 200ms, error rate < 1%
Closes StellarTips#71

Copy link
Copy Markdown
Contributor

K6 load tests with proper thresholds and a CI workflow is going to catch regressions early. Nicely done — merged.

@nanaf6203-bit nanaf6203-bit merged commit 622d696 into StellarTips:main Jun 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add load/performance tests using k6 for API throughput baselines

2 participants