CI exit codes

When motionpr exits 0, 1, 2, 130 or 143, and how to change it.

On this page
  1. How run decides
  2. Changing the threshold
CodeMeaning
0Success; the comparison is within the configured thresholds
1A difference reached comparison.failOn (or --threshold)
2Configuration, execution or comparison error, including usage errors
130Interrupted by Ctrl+C, after servers and the browser were stopped
143Interrupted by SIGTERM, after servers and the browser were stopped

How run decides

SituationExit code
No difference at or above failOn0
A difference at or above failOn1
failOnUncertain: true and an uncertain difference1
A scenario failed in the candidate1 (scenario-failed is critical)
No baseline, locally0, with a capture-only report
No baseline, in CI2, unless --allow-missing-baseline
Invalid config, browser missing, server did not start2
Unknown --browser name2
Baseline and candidate from different engines2 (BROWSER_MISMATCH), unless --against / --cross-browser

With several engines (--browser all), the run's exit code combines theirs: 2 if any engine could not run (or, in CI, had no baseline), otherwise 1 if any engine exceeded failOn, otherwise 0. An engine that fails to launch does not stop the others.

motionpr capture exits 2 when any scenario failed. motionpr baseline accept exits 2 when it refuses to replace a baseline without --yes.

Changing the threshold

TypeScript
comparison: {
  failOn: "warning";
} // critical | warning | info | never
Shell
npx motionpr run --threshold never   # report, never fail (exit 0 or 2)

never turns MotionPR into a reporting-only step: differences are listed and the report is written, but only errors fail the job.