The tests
tests/smoke/signup.test.yaml
url: --url-override points them at whichever
deployment fired the event.
The workflow
The job installsmomentic from devDependencies, so your lockfile pins the
CLI version. Add it once with npm install -D momentic.
.github/workflows/preview-smoke.yml
deployment_statusfires for Vercel and any provider that posts a GitHub deployment.environment_urlis the preview URL. For providers that do not post deployments, poll for the URL first: see the Next.js on Vercel guide for the wait-for-preview variant.deployment.environment != 'Production'keeps staging and production deployments from re-running the preview suite. Match the environment names your provider posts (Vercel usesPreviewandProduction).--url-overridereplaces each test’surland each environment’sbaseUrl.- Drop the
--custom-headerspair when the preview is public. For protection-bypass details, see Vercel preview auth.
Decisions
- Labels vs selection.
--labels smokeis a fixed list;--ai-selectpicks tests from the diff. Use the label for a fast universal gate, selection when the suite is large, or both. - What belongs in smoke. A handful of end-to-end happy paths that finish in minutes. If the preview job takes longer than a reviewer waits, it is doing regression work. Move those tests to the nightly suite.
- Failure is not rollback. A preview failure blocks a merge; it does not roll anything back. For post-deploy rollback gating, see the deploy-gate workflow in Common CI setups.