Performance test suite built with k6 and JavaScript, covering smoke, load, stress, spike, and soak testing scenarios with a full CI pipeline via GitHub Actions.
This project demonstrates a structured performance testing framework using k6. It covers five core test types to validate system behavior under different load conditions against the JSONPlaceholder REST API, with automated execution via GitHub Actions.
| Type | VUs | Duration | Purpose |
|---|---|---|---|
| Smoke | 1 | 30s | Verify system works under minimal load |
| Load | up to 50 | ~2m | Validate normal expected traffic |
| Stress | up to 200 | ~3m | Find the breaking point |
| Spike | up to 500 | ~50s | Test sudden extreme traffic surges |
| Soak | 20 | ~14m | Catch degradation over sustained load |
k6-load-testing/
├── .github/
│ └── workflows/ # GitHub Actions CI configuration
├── config/
│ └── config.js # Shared BASE_URL and thresholds
├── tests/
│ ├── smoke/ # Smoke test - 1 VU, 30s
│ ├── load/ # Load test - ramp to 50 VUs
│ ├── stress/ # Stress test - ramp to 200 VUs
│ ├── spike/ # Spike test - burst to 500 VUs
│ └── soak/ # Soak test - sustained 20 VUs for 10m
├── utils/
│ └── helpers.js # Reusable check functions
└── .gitignore
- k6 installed locally
# Windows (via Chocolatey)
choco install k6
# Or download from https://k6.io/docs/getting-started/installation/# Smoke
k6 run tests/smoke/smoke.test.js
# Load
k6 run tests/load/load.test.js
# Stress
k6 run tests/stress/stress.test.js
# Spike
k6 run tests/spike/spike.test.js
# Soak
k6 run tests/soak/soak.test.js
# Save results to JSON
k6 run tests/load/load.test.js --out json=reports/load-results.json| Endpoint | Methods Tested |
|---|---|
| /posts | GET, POST, PUT, PATCH, DELETE |
| /posts/:id | GET |
| /users | GET |
| /users/:id | GET |
| /comments?postId=1 | GET |
| /albums | GET |
| /photos?albumId=1 | GET |
| /todos/:id | GET |
- 5 test types — smoke, load, stress, spike, and soak scenarios
- Full CRUD coverage — GET, POST, PUT, PATCH, DELETE all tested
- Shared config — centralized thresholds and BASE_URL in config/config.js
- Reusable helpers — checkStatus, checkBody, checkArray in utils/helpers.js
- GitHub Actions CI — automated runs on every push
- Response validation — status codes, body fields, and array lengths all asserted