Interview Prep/CI/CD/Testing and Quality Gates

How are performance and load tests used as pipeline gates?

AdvancedConceptTesting and Quality Gates
Answer

After deploying to a production-like environment, run a short load test with pass/fail thresholds so regressions fail the pipeline. With k6, thresholds make the process exit non-zero.

export const options = {
  vus: 50, duration: '2m',
  thresholds: {
    http_req_failed: ['rate<0.01'],
    http_req_duration: ['p(95)<400'],
  },
};

Run full-scale soak tests nightly rather than on every commit, and compare results against a baseline to detect trends instead of single-run noise.

All CI/CD questions Roadmap: CI/CD fundamentals

More on Testing and Quality Gates