Skip to main content
The nightly job runs the whole suite against staging or production on a schedule. It catches the regressions that PR-scoped checks miss.

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/nightly.yml

Decisions

  • Shards. Size --shard-count to keep each shard under ~15 minutes. Hosted browsers (browser.remoteBrowser: true) remove the browser footprint from your runners and raise parallelism; see hosted test environments.
  • Environment. --env staging picks the staging entry in momentic.config.yaml; secrets for it live in CI, not the repo. See environments.
  • One run group. Merging shard output keeps the dashboard view and triage scoped to the whole night, not four partial views.
  • Triage in the same job. Running ai triage after the upload lets auto-maintenance repair drifted tests before the next night, and classifications land on the merged run group.
  • workflow_dispatch. Keep the manual trigger; debugging a nightly should not require a fake commit.

Triage failures

A nightly suite fails more often than a PR gate, by design. Keep it actionable:
  • Quarantine flakes instead of deleting them; they keep producing data.
  • Give each test an owner: label so the right person reads the failure.
  • Watch the trend, not one night: a test that fails twice in a week wants a fix, not a retry.