critical on each pull request and make the
job a required status check. A counted failure then blocks the merge.
The tests
Label the flows whose failure means “do not ship”:tests/critical/checkout.test.yaml
critical label under roughly ten tests. Every test in the gate is a
flow you would roll back for: sign-in, checkout, the primary write action. Edge
cases belong in the nightly suite, not the gate.
The workflow
The job installsmomentic from devDependencies, so your lockfile pins the
CLI version. Add it once with npm install -D momentic.
.github/workflows/critical-path.yml
--labels criticalruns only labeled tests.--upload-resultsattaches the run group to the dashboard, where you can inspect failure traces and any recorded video.-yskips confirmation prompts in CI.
Make it required
In GitHub, add the job’s check name (Critical flows / test) to the branch
protection’s required status checks. Until then the gate is advisory.
Flake policy for a gate
A gate that flakes trains people to click “re-run” instead of reading the failure. Two controls:- A quarantined test still runs but does not fail the check by default. Use
--skip-quarantinedto drop them from the gate entirely, or--ignore-quarantineto count every status. See quarantine. --retries 1gives a failing test one more run. Choose a retry budget that fits the gate timeout, and investigate repeated failures.
When the gate is slow
Swap--labels critical for AI test selection
(--ai-select --ai-select-base origin/main) so the PR only runs the tests that
cover its diff. Fetch the base branch and enough Git history for the comparison.
See Common CI setups for the deployment-triggered
variant.