TestNeo
TestNeo Docs k6 · Load Insights
Load testing

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.

Important: k6 does not run inside TestNeo Cloud. The kit hits your API directly (BASE_URL). No TestNeo API key is required for the load run itself. Insights appear after you upload the summary JSON.
API NLP suite (Test Manager) → Export k6 Load Kit (.zip) or single .js + helpers → Unzip · set BASE_URL · ./run-smoke.sh or ./run-load.sh → k6-out/testneo-import.json (and *-summary.json) → App → Load Insights → Upload → verdict + trends

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.

1

Open Test Manager

Go to app.testneo.ai → your project → Test Cases (Test Manager).

2

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.

3

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.

4

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 .js script plus run-with-summary.sh and collect-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)

  1. Unzip the kit and open the folder in your IDE (or commit it to your repo).
  2. 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
  3. Make runners executable (Unix):
    chmod +x run-smoke.sh run-load.sh scripts/run-with-summary.sh 2>/dev/null || true
  4. 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
  5. Collect results — kit helpers write summaries under k6-out/ and aggregate to k6-out/testneo-import.json when 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_URL at 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

  1. In the app sidebar open Load Insights (/web/load-insights).
  2. Select the same project you exported from.
  3. Upload one of:
    • k6-out/testneo-import.json (preferred — multi-run aggregate from the kit)
    • Any k6-out/*-summary.json from k6 run --summary-export=…
    • Optional: JMeter CSV / other supported formats listed in the upload UI
  4. Review the verdict, p95 / p99, error rate, throughput, failed checks, and recommendations.
  5. Use history / compare to spot regressions across builds (optional git branch / commit metadata when present).
Tip: Treat Load Insights as release evidence beside functional runs — not as a live cloud load engine. Functional pass + load FAIL/WARN is still a ship risk signal.

Load profiles (export options)

ProfileIntentTypical shape
smokeQuick sanity~5 VUs · 30s constant
loadStaging pressure~50 VUs · 5m constant
rampStaged warm-up0→30 VUs ramp · hold · down
spikeBurst / recover5→100 VU spike · recovery
soakEndurance~20 VUs · 30m

Exact VUs/duration can still be overridden via VUS / DURATION / env after export.

Supported upload formats

  • k6 summary JSON — from --summary-export or 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.md when selected at export.
  • Store BASE_URL and auth tokens as pipeline secrets.
  • Archive k6-out/ as a build artifact; upload testneo-import.json to 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 wellNot 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

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