This automation framework contains a performance testing setup using K6, with results stored in InfluxDB and visualized in Grafana.
- Node.js and npm - https://nodejs.org/en/download
- Docker and docker compose - https://docs.docker.com/desktop/setup/install/windows-install/
- K6 - https://grafana.com/docs/k6/latest/set-up/install-k6/
K6GRAFANA/
├── .github/
│ └── workflows/
│ └── main.yml # CI/CD with GitHub Actions
├── config/
│ └── option.js # K6 options (scenarios, thresholds, etc.)
├── data/ # Static test data
├── helper/
│ ├── apiHelper.js # Common API request helpers
│ └── dataHelper.js # Data manipulation helpers
├── scripts/
│ └── grafana.test.js # Example test script
├── .env # Environment variables
├── docker-compose.yml # Run InfluxDB + Grafana
├── makefile # Shortcuts for common commands
├── package.json # Node.js dependencies
└── README.md # Project documentationmake up # start service: influxdb, grafana
make test # run test
- Go to Actions tab
- Select k6 Load Test with Docker Compose Actions
- Click Run workflow dropdownlist => select branch and click Run workflow button
- Grafana runs on http://localhost:3000 with default credential: admin/admin
- Add InfluxDB as a Data Source in Grafana
- Import the official k6 dashboard JSON from:https://grafana.com/grafana/dashboards/2587