This project contains k6 load tests and demonstrates CI execution via Docker.
project/
├── scripts/
│ ├── smoke.js # Quick smoke test, minimal load
│ ├── load.js # Ramp-up load test, multiple endpoints
│ ├── stress.js # Stress test with higher concurrency
│ └── utils.js # Helper functions (request wrapper, sleep)
├── results/ # JSON reports (optional) or CLI output screenshots
└── README.md
Set the target base URL using the environment variable TARGET_BASE_URL.
# Smoke test
TARGET_BASE_URL=https://localhost k6 run scripts/smoke.js
# Load test
TARGET_BASE_URL=https://localhost k6 run scripts/load.js
# Stress test
TARGET_BASE_URL=https://localhost k6 run scripts/stress.js--insecure-skip-tls-verify→ Use when testing local HTTPS endpoints with self-signed certificates.--out json=results/load.json→ Export test results in JSON format for analysis or reporting.
- The workflow runs all three scripts using Docker and GitHub Actions.
- For the POC, the workflow is configured to continue running subsequent tests even if one test fails, so that all metrics are collected and visible.
- CLI output provides key metrics such as iteration count, request duration, and failed requests.
- Thresholds are enforced in scripts, but for the POC the workflow continues on failures to allow full test execution.
- For production-grade performance testing, it’s recommended to fail the CI step if thresholds are crossed.
- CLI output is sufficient for the POC; HTML/JSON reports can be generated optionally if detailed reporting is needed.


