Skip to main content
Run a small set of tests labeled 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
Keep the 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 installs momentic from devDependencies, so your lockfile pins the CLI version. Add it once with npm install -D momentic.
.github/workflows/critical-path.yml
  • --labels critical runs only labeled tests. --upload-results attaches the run group to the dashboard, where you can inspect failure traces and any recorded video.
  • -y skips 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-quarantined to drop them from the gate entirely, or --ignore-quarantine to count every status. See quarantine.
  • --retries 1 gives 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.