Lesson 3 of 5
Automated gates
14 min
In a quarterly release, a person can review every change. In a monthly or faster train, people review exceptions, and machines check everything else. An automated gate is a check that runs without being asked, has a clear pass or fail rule, and blocks promotion when it fails. Good gates are fast, trusted and hard to bypass quietly.
The gate stack
Static checks: ATC
The ABAP Test Cockpit runs static checks on ABAP code: performance, security, robustness and S/4HANA compatibility. In a gate, the rule must be explicit. The Project "Piper" gCTS quality-check step, for instance, treats ATC priority 1 and 2 findings as errors and priority 3 as warnings, and writes results in a standard format that a CI server can display. Contoso uses the same rule on classic CTS: no transport is released with priority 1 or 2 findings unless an exemption is approved.
Unit tests: ABAP Unit
ABAP Unit tests are code-level tests written by developers inside ABAP classes. They are the fastest feedback there is: seconds, not days. They only work as a gate if they exist. Contoso's rule for new custom code is that every public method of a new class has at least one ABAP Unit test, and the gate runs the tests for every changed object. The piper step can scope checks to changed objects or packages from the last commit, which keeps the gate fast. SAP's guidance is not to run unit tests in client 000 or in production.
Regression: the expensive gate
Process regression in CMQ is the gate that protects the business. It is also the slowest. Keep it focused: automate the critical end-to-end flows (order to cash for Great Lakes Fleet Services, procure to pay with Lakeside Components, period-end close in company codes 1710 and 1810) and run them against every train's content. Results are recorded as test runs linked to the release, so the release gate can read them. For SAP S/4HANA Cloud Public Edition, SAP's Test Automation Tool provides automated tests; for private cloud and on-premise, teams use automated scripts that record results in Cloud ALM.
| Gate | Pass rule at Contoso | Runs | Owner of exceptions |
|---|---|---|---|
| ATC | No priority 1 or 2 findings, or approved exemption | Every transport release or commit | Kenji |
| ABAP Unit | All tests for changed objects pass | Every transport release or commit | Kenji |
| Transport checks | No unresolved downgrade or cross-reference conflicts | Per feature and per train bundle | Luis |
| Feature tests | Linked test cases executed and passed in CMQ | Per feature before Successfully Tested | Priya |
| Automated regression | 100% of critical flows pass; failures triaged within one day | Per train after cut-off | Priya |
Automated gates, their rules and who may grant exceptions.
- Is the failure in a test or check that has failed intermittently before?Yes → quarantine the flaky test, fix it within the train, and decide on manual evidence · No → next question
- Is it a real defect in train content?Yes → fix or remove the feature from the train · No → next question
- Is it an environment or data problem?Yes → fix the environment and rerun · No → escalate to Luis and Priya
Keeping gates trusted
- A gate that fails randomly gets ignored. Track flaky tests and fix or quarantine them quickly.
- Every exemption has an owner, a reason and an expiry, and is visible on the feature.
- Gate rules live in version-controlled configuration; changing them is itself a controlled change.
- Measure gate run time; a gate that takes days pushes teams to bypass it.
What would you do?
The automated regression for the train fails on one step: the period-end close flow for company code 1810 fails while posting an accrual. It passed last month. Grace asks whether the train can go anyway. What should happen?
- Automated gates run unasked, have clear pass rules and block promotion when they fail.
- Stack gates: fast developer and commit checks, then integration, then release.
- ATC priority 1 and 2 findings and failing ABAP Unit tests block; exemptions have owners and expiry.
- Keep regression focused on critical flows and keep every gate trusted, fast and controlled.
Check your understanding · not graded
Lesson check
1. In the Project "Piper" gCTS quality checks, how are ATC priority 1 and 2 findings treated?
2. Where should ABAP Unit tests not be run, according to the Piper documentation?
3. What is the main problem with a flaky gate?
4. Which gate is typically the slowest and most expensive?