Skip to content

Exit Codes

nolapse uses process exit codes so CI systems can act on results without parsing output text. There are three categories: success (exit 0), enforcement failure (exit 1), and error (any other non-zero code).


CodeCategoryWhen it occurs
0Passnolapse run — delta is above the warn threshold. Coverage is healthy.
0Warnnolapse run — delta is below the warn threshold but above the fail threshold, and --strict-mode is off.
1Failnolapse run — delta is at or below the fail threshold. Coverage regression is too large.
1Strict warnnolapse run — outcome is warn and --strict-mode is enabled.
Non-zeroErrorAny command — configuration problem, missing baseline, git unavailable, or test runner crash.

The nolapse run outcome is determined by comparing delta (current coverage minus baseline coverage) against the configured thresholds:

ConditionOutcomeExit code (normal)Exit code (strict mode)
delta > -warn_thresholdpass00
-fail_threshold < delta ≤ -warn_thresholdwarn01
delta ≤ -fail_thresholdfail11

Default thresholds: warn_threshold = 0.5, fail_threshold = 1.0.


By default, a warn outcome exits 0. This lets teams see a warning in the CI log without blocking the merge. When you want any regression — even a small one — to block merges, enable strict mode:

Terminal window
nolapse run --repo . --strict-mode

Or set it permanently in nolapse.yaml:

strict_mode: true

With strict mode on, both warn and fail outcomes exit 1.


A step that exits non-zero is marked as failed, which causes the job to fail. If the job is listed as a required status check on the branch, GitHub blocks the pull request from merging.

- name: Enforce coverage
run: nolapse run --repo .
# Exit 1 from nolapse → step fails → job fails → merge blocked

To report without blocking, use continue-on-error:

- name: Report coverage (non-blocking)
run: nolapse run --repo .
continue-on-error: true

A job that exits non-zero is marked as failed. Use allow_failure: true for a non-blocking report:

coverage-check:
script: nolapse run --repo .
allow_failure: true # warn without blocking pipeline

Steps that exit non-zero fail the job. Use when: always with a custom outcome handling script if you want to report without failing.


Any exit code other than 0 or 1 from nolapse indicates a runtime or configuration error — not an enforcement decision. Common causes:

  • baseline.md does not exist (run nolapse init first).
  • nolapse.yaml is malformed or missing required fields.
  • The git binary is not available in PATH.
  • The test runner (go test or pytest) failed to produce coverage output.
  • NOLAPSE_RUNNER_PATH points to a file that does not exist (Python projects).

Check the error message printed to stderr for the specific cause.