Q31 of 38 · CI/CD & DevOps
How do you include performance tests in a CI pipeline without blocking fast feedback?
Short answer
Short answer: Run a fast performance smoke (low VU count, 60–90 seconds) on every PR to catch regressions. Reserve full load tests for a dedicated nightly or pre-release stage. Use thresholds to fail the pipeline on breach, not just on error.
Detail
Full load tests (hundreds of virtual users, 30+ minutes) do not belong in a PR pipeline — they make every merge take an hour. The solution is a two-tier approach.
PR performance smoke: a short k6 or Gatling run with 10–20 virtual users for 60–90 seconds against a staging or ephemeral environment. Set tight thresholds (p95 under 500 ms, error rate under 1%). If a PR introduces a slow query or an N+1, the smoke catches it without waiting for nightly.
Nightly / release gate: full realistic workload, soak phase, spike scenario. This is where you validate capacity, not just regression. Failures at this stage should block the release candidate from promotion, not just create a notification.