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.
More on Testing and Quality Gates
What is the testing pyramid?BeginnerWhat is the difference between unit, integration, and end-to-end tests?BeginnerWhat are smoke tests and sanity tests in a deployment pipeline?IntermediateWhat is code coverage and is a high percentage a good target?IntermediateWhat is a quality gate in SonarQube?IntermediateHow do you integrate SonarQube into a CI pipeline and make it block on gate failure?Intermediate