CI/CD Pipelines: Releases, Rollbacks, and Quality Gates/Fail if test coverage drops below threshold

Enforce a minimum quality bar in CI.

Section: Stop bad builds from reaching users

Fail if test coverage drops below threshold

bash
bash
npm test -- --coverage
node scripts/check-coverage-threshold.js
Explanation

Coverage thresholds are blunt instruments, but they can still catch major regressions when used carefully.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Stop bad builds from reaching users
Run smoke tests after deployment
Verify critical endpoints before marking a release healthy.
OpenIn sheetbashsame section
Run database migrations during deploy
Apply migrations as an explicit pipeline stage.
OpenIn sheetbashsame section
Release from version tags
Trigger a release pipeline when a semver tag is pushed.
Canary deploy flow
Send a small portion of traffic to the new version before full rollout.
Rollback to the previous version
Keep a simple rollback command or job ready before each production deploy.