k6 Load Export & Insights
Use the same API NLP suites you already run for functional checks. Export a Grafana k6 kit from TestNeo, run load on your machine or CI, then upload results back for Load Insights — p95, error rate, throughput, and pass / warn / fail verdicts over time.
BASE_URL). No TestNeo API key is required for the load run itself. Insights appear after you upload the summary JSON.
Prerequisites
- An account with k6 export enabled (Admin → user settings →
k6_export_enabled). When enabled, sidebar shows Load Insights. - A project with API-oriented NLP tests (HTTP / OpenAPI / Postman flows work best).
- Grafana k6 installed locally, or Docker with
grafana/k6. - Network reachability from your runner to the API under test.
1. Export a k6 load kit from the app (recommended)
Best for a whole suite or selected cases — mirrors your Test Manager grouping.
Select tests
Select one or more API test cases (or a suite). Prefer HTTP/API flows; UI-only steps are skipped and listed in manifest.json.
Export → k6 Load Kit
Open Export → choose k6 Load Kit (.zip). Pick a load profile (smoke / load / ramp / spike / soak) and optional CI template (e.g. GitHub Actions). Download the ZIP.
Follow in-app next steps
The export dialog shows the same checklist: unzip → .env → run scripts → upload to Load Insights.
2. Export a single test case (optional)
From a test case editor, use Export k6 load script when you only need one scenario.
- Downloads a
.jsscript plusrun-with-summary.shandcollect-results.py. - Copy the env snippet (
BASE_URL,VUS,DURATION,K6_LOAD_PROFILE). - Review any skipped steps / warnings — UI clicks and pure browser steps don’t compile to protocol k6.
3. Run k6 locally (end-to-end)
- Unzip the kit and open the folder in your IDE (or commit it to your repo).
- Configure env:
cp .env.example .env # edit .env — set BASE_URL to the API under test # optional: API_TOKEN / auth headers used by generated scripts
- Make runners executable (Unix):
chmod +x run-smoke.sh run-load.sh scripts/run-with-summary.sh 2>/dev/null || true
- Execute:
./run-smoke.sh # quick sanity load # or ./run-load.sh # heavier profile from export options
Without helper scripts you can still run:k6 run --summary-export=k6-out/my-run-summary.json scripts/…/my_load_test.js
Docker alternative if k6 isn’t installed:docker run --rm -i -v "$PWD":/work -w /work \ -e BASE_URL -e VUS -e DURATION \ grafana/k6:latest run scripts/…/my_load_test.js
- Collect results — kit helpers write summaries under
k6-out/and aggregate tok6-out/testneo-import.jsonwhen Python 3 is available.
4. Tweak endpoints, VUs, and duration
Before a serious run, edit env (or shell exports) — you don’t need to re-export from TestNeo for small knobs:
export BASE_URL=https://staging-api.example.com export K6_LOAD_PROFILE=load # or smoke | ramp | spike | soak export VUS=50 export DURATION=5m ./run-load.sh
- Point
BASE_URLat staging/prod as your policy allows. - Change profile or VUs to match the SLO you care about.
- Auth secrets stay in
.env/ CI secrets — never commit them. - Re-export from TestNeo when NLP steps / suite membership change.
5. Import results into Load Insights
- In the app sidebar open Load Insights (
/web/load-insights). - Select the same project you exported from.
- Upload one of:
k6-out/testneo-import.json(preferred — multi-run aggregate from the kit)- Any
k6-out/*-summary.jsonfromk6 run --summary-export=… - Optional: JMeter CSV / other supported formats listed in the upload UI
- Review the verdict, p95 / p99, error rate, throughput, failed checks, and recommendations.
- Use history / compare to spot regressions across builds (optional git branch / commit metadata when present).
Load profiles (export options)
| Profile | Intent | Typical shape |
|---|---|---|
smoke | Quick sanity | ~5 VUs · 30s constant |
load | Staging pressure | ~50 VUs · 5m constant |
ramp | Staged warm-up | 0→30 VUs ramp · hold · down |
spike | Burst / recover | 5→100 VU spike · recovery |
soak | Endurance | ~20 VUs · 30m |
Exact VUs/duration can still be overridden via VUS / DURATION / env after export.
Supported upload formats
- k6 summary JSON — from
--summary-exportor kit*-summary.json - testneo-import.json — aggregated by the kit collector
- JMeter / other — see the formats listed in the Load Insights upload panel when enabled
CI tips
- Kit includes a CI scaffold (e.g. GitHub Actions) and
CI_SETUP.mdwhen selected at export. - Store
BASE_URLand auth tokens as pipeline secrets. - Archive
k6-out/as a build artifact; uploadtestneo-import.jsonto Load Insights manually or via your automation. - Keep k6 workers off your shared app server — run on a dedicated runner or ephemeral CI job.
What k6 can / cannot compile
| Works well | Not in v1 protocol k6 |
|---|---|
| HTTP GET/POST/PUT/DELETE, headers, auth, JSON checks, variable chaining | Pure UI steps (click, assert page title, DOM) |
| API suites from OpenAPI / Postman NLP | Step screenshots / Playwright video |
Skipped UI-only tests are listed in manifest.json inside the kit — keep them as functional Playwright runs in TestNeo.
Troubleshooting
| Symptom | Fix |
|---|---|
| No “Load Insights” in sidebar / export missing | Ask admin to enable k6_export_enabled for your user; refresh the app. |
| Upload rejected / 403 | Same flag must be on; confirm you’re on the correct project. |
Empty k6-out/ |
Ensure the run script uses --summary-export; install k6 or Docker; check script path. |
No testneo-import.json |
Install Python 3 for the collector, or upload individual *-summary.json files. |
| Many skipped steps | Export API-focused cases, or split UI vs API into different suites. |
| Auth failures under load | Verify tokens in .env; rate limits / lockouts on the target env. |
Quick links
Last updated July 2026 · Matches Test Manager k6 Load Kit export + Load Insights import in the web app.