Blog 8 min read
Quality gates: when should a test block a release?
- devops
- test-automation
- e2e-testing
- quality-assurance
- security
An E2E test fails in the pipeline. Should the release be stopped immediately?
The answer should be neither “always” nor “never”. A useful quality gate turns a risk policy into verifiable conditions. Its job is not to produce more red: it must prevent a change whose risk exceeds the accepted level from moving on to the next stage.
DevOps platforms already embody this principle. GitHub can require status checks to pass before a merge. GitLab uses merge checks — pipeline, external status checks, approvals or other controls — that govern whether the merge button is available. SonarQube defines a quality gate as a set of conditions that answers one simple question: is the project ready for release?
1. A quality gate is not “every test must be green”
The simplest reflex is to make the whole campaign blocking. But a critical E2E test, a cosmetic test, an experimental scenario and a flaky test do not carry the same risk.
The gate must therefore distinguish at least three decisions: GO, REVIEW and BLOCK.
GO means the blocking criteria are met. REVIEW means a signal requires a human decision or an investigation. BLOCK means a condition defined as incompatible with the release has been met.
2. First criterion: business criticality
A journey must be classified before it becomes blocking. Authentication, payment, transfer, subscription or activation may be critical depending on the product. A visual alignment issue on a secondary page usually does not carry the same risk.
A simple matrix can combine user impact, financial impact, usage frequency, regression scope and regulatory or security requirements.
The result is not necessarily a universal score. What matters is that the rule is explicit and stable: which P0/P1 journeys absolutely must succeed before a release?
3. Second criterion: test reliability
A test should not get veto power until its own signal is trustworthy.
The previous article, “False positives in automated testing: when a green test lies”, distinguished PASS, FAIL and FLAKY. That distinction becomes operational here. A critical, stable scenario can be blocking. A critical but flaky scenario can trigger REVIEW and an investigation rather than a permanent automatic block.
A mature gate must also tell a product failure apart from a test infrastructure failure: an unavailable device, an offline robot, an unreachable environment or invalid test data do not automatically mean the release contains a defect.
4. Third criterion: a measurable condition
A quality gate must be explainable through a condition. SonarQube illustrates this model well: each condition combines a metric, a comparison operator and an error value, and the code passes or fails the gate depending on the result.
For E2E journeys, conditions can be functional or non-functional: 100% of P0 journeys passed; no critical security defect; a minimum success rate on a stable subset; no performance regression beyond an agreed threshold; or no occurrence of a defined error category.
Numeric values must be decided based on risk and historical data. A threshold invented without a historical baseline turns the quality gate into an arbitrary rule.
5. Watch out for “skipped” checks and ambiguous states
One CI/CD nuance is especially important: “not executed” does not mean “failed”. On GitHub, a skipped job reports its status as “Success” and does not prevent a pull request from merging, even if it is a required check.
So you need to check not only the final status, but also that the expected tests actually ran. For a critical E2E gate, a missing result can be a distinct state — for example INCONCLUSIVE — that triggers REVIEW or BLOCK depending on the policy.
In other words, PASS, FAIL, FLAKY, SKIPPED and INFRA_ERROR should not be flattened into a single boolean.
Recommended verdict model — PASS = evidence obtained; FAIL = business criterion not met; FLAKY = unstable result; INFRA_ERROR = measurement impossible for a technical reason; SKIPPED = test not executed; INCONCLUSIVE = insufficient evidence. The gate policy then decides how to handle each of these states.
6. A multi-layer quality gate
| Layer | Example | Possible decision | Why |
|---|---|---|---|
| Build / Unit | Compilation or critical unit tests failed | BLOCK | The product cannot be technically validated |
| Code quality | SonarQube condition not met | BLOCK / REVIEW | Depending on the quality policy |
| Security | Blocking vulnerability as defined by the policy | BLOCK | Unaccepted security risk |
| API / Integration | Critical API not compliant | BLOCK | Essential contract or service broken |
| E2E P0 | Critical authentication or payment failed, reliable test | BLOCK | High business risk |
| E2E P1/P2 | Secondary journey failed | REVIEW | Trade-off based on impact |
| Performance | Regression beyond the threshold | REVIEW / BLOCK | Depending on the performance budget |
| Flaky / Infra | Unreliable result | REVIEW | Do not confuse a product defect with a measurement defect |
7. The gate should look at the change, not only at historical debt
An overly blunt policy can make it impossible to improve an existing system: if the product already has hundreds of historical defects, demanding their complete removal for every merge blocks any change.
SonarQube applies exactly this new-code logic to pull requests: only conditions defined on new code are evaluated, new code being whatever has changed relative to the target branch.
The same principle can be applied to E2E tests: gradually raise requirements on new journeys and modified areas, while managing existing debt separately.
8. An exception must be possible — but traceable
There are situations where the business explicitly accepts the risk: a known incident, a scheduled fix, an unavailable third-party dependency, a launch window or a security emergency.
A serious quality gate can allow an exception, but it must have an owner, a justification, a duration and, ideally, an incident or ticket reference.
GitHub and GitLab offer various forms of rules, checks and approvals — on GitLab, required approvals and blocking external status checks depend on the subscription tier and project configuration. The organizational idea stays the same: an exception must not be an “ignore” button with no accountability.
9. After the release: the quality gate is no longer enough
Passing the gate reduces risk; it does not guarantee that production will stay healthy.
Differences in traffic, data, network, third-party systems and configuration can reveal problems after deployment. This is where QoS monitoring joins the release strategy: critical journeys can keep running as synthetic checks.
In an SRE approach, SLOs and error budgets can also influence the pace of change. Google describes, for example, a policy where, once the error budget is exhausted, all changes and releases are halted — other than P0 issues and security fixes — until the service is back within its SLO.
10. A simple policy to get started
An organization does not need twenty rules on day one. It can start with a minimal, explicit gate:
- BLOCK: invalid build, critical security issue as defined by the policy, or a reproducible failure of a P0 journey.
- REVIEW: flaky P0, P1 failure, performance regression, infrastructure error or incomplete evidence.
- GO: all blocking criteria are met and any non-blocking alerts are known.
Thresholds are then refined using release history, incidents and false blocks. For the place of tests in the continuous integration chain, see also “DevOps et Tests Automatisés : L’Intégration Continue Réinventée” (in French).
11. The SYMA ROBOT approach
In SYMA ROBOT, the aim is to evolve the E2E result into a signal directly usable in the release process: scenario criticality, execution status, evidence, duration, technical cause when it can be identified, and stability history.
A CI/CD integration can then consume a structured result rather than a plain “test failed”. The gate decides according to the company’s policy: block, request a review or let it through.
Over time, the same logic can connect the pre-production quality gate with production monitoring: the journey that protects the release also becomes the one that watches the service after deployment.
Key takeaway — A quality gate is not a collection of tests. It is an executable risk policy. To block a release, the signal must be critical, reliable, measurable and governed.
Conclusion
The best quality gate is not the one that blocks the most. It is the one that blocks the wrong releases without turning quality into an arbitrary obstacle. That means classifying journeys, making tests reliable, formalizing thresholds, separating measurement errors and tracing exceptions. The result then becomes an explainable release decision — not just a red light in a pipeline.
Your E2E tests already produce results? Request a SYMA ROBOT demo: we structure them into quality signals usable in your CI/CD and continuous monitoring.
Sources
Documentation consulted on November 1, 2026. Official documentation is preferred; these references are not endorsements.
- GitHub Docs — Available rules for rulesets, Status checks and Using conditions to control job execution
- GitLab Docs — Merge request concepts (merge checks), External status checks and Merge request approvals
- SonarQube Server — Understanding quality gates
- Google SRE — Production Services Best Practices and Error Budget Policy