Skip to content

st2f/k6-poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

K6 Performance POC

k6 Performance Testing Project

This project contains k6 load tests and demonstrates CI execution via Docker.

Project Structure

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

Running Tests Locally

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

Optional Flags

  • --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.

CI Execution

  • 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.

Sample Results

  • Smoke test → CLI screenshot k6-smoke-test-local

  • Load test → GitHub Actions screenshot k6-load-test

  • Stress test → GitHub Actions screenshot k6-stress-test


✅ Notes / Best Practices

  • 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.

About

k6 performance testing POC with smoke, load, and stress scripts; CI execution via Docker

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published