k6 load testing

Integrate performance gates in CI

Expert190 pts~70 min
  • CI/CD
  • Performance gates
Practice app · Checkout Service

A load-testable checkout service with realistic latency that degrades under concurrency, plus a live metrics view.

BASE_URL
/api/practice
Console app
/lab/sdet-integrate-performance-gates-in-ci

Your starter code already declares BASE_URL — call the API relative to it.

Objective

Write a fast CI performance gate whose thresholds fail the pipeline on regressions.

Your task

  1. 1Set options { vus: 5, iterations: 50 }.
  2. 2thresholds: 'http_req_duration': [{ threshold: 'p(95)<600', abortOnFail: true }], 'http_req_failed': ['rate<0.01'], 'checks': ['rate>0.99'].
  3. 3GET BASE_URL + "/perf/checkout" with check status 200 and body status "confirmed".
  4. 4Keep the run under 20 s so it fits a pull-request pipeline.

Acceptance criteria

  • GET /perf/checkout returns 200
  • Latency, error and check thresholds are declared
  • ≥ 50 requests with p95 < 800 ms and error rate < 1%
  • At least 50 check() calls pass

k6 load testing · SDET · Scaling & analysis