Results and exit codes

Interpret test statuses, failure classes, result fields and process exit codes.

A test result says what Retest observed; the run result says whether the selected work finished reliably. Read both when deciding whether a release check passed, especially when a browser stopped or evidence could not be saved.

Terminal
npx retest inspect .retest/runs/<time> --json

This prints the saved run result without opening a browser. Its top-level status, exitCode and complete describe the run. Individual results are under files[].tests[]. The inspect command itself exits 0 when it reads the folder successfully, even when the saved run failed.

Test statuses Link to Test statuses

StatusMeaning
passedThe test and its required checks passed, and cleanup introduced no failure.
failedA check, action, timeout or test-code rule failed. Read failure.class for the cause.
errorRetest could not obtain or finish a reliable result, such as a lost session or cleanup failure.
not_runThe selected test never ran, for example because its setup failed.
inconclusiveA required AI check returned a valid answer that could not decide the requirement.
skippedtest.skip or a skipped group deliberately kept the test from running. It is never counted as passed.

outcome_unknown is a failure class, not a separate test status. It produces error because an action was dispatched but Retest could not establish its effect. Retest does not repeat that action to obtain a clearer answer.

Run statuses and completeness Link to Run statuses and completeness

Run statusExit codeMeaning
passed0Selected work passed and finished cleanly. Declared skips may be present.
failed1At least one test failed, subject to the precedence rules below.
error2The run could not check everything or keep a trustworthy output.
interrupted130 or 143A signal or a programmatic cancellation stopped the run.

complete: true means selected tests settled as passed, failed or skipped, files ended cleanly and required output was kept. A completed run can fail its checks. complete: false means some work or required evidence remains uncertain.

A run narrowed by test.only can pass while checking only part of the suite. Its narrowed field names the focused declarations and reports how many tests they kept. A baseline-update run also records baselinesWritten, so you can distinguish it from an ordinary comparison run.

Exit codes Link to Exit codes

CodeMeaningWhat to do
0At least one test ran and the selected work passed. Declared skips do not prevent it.Check narrowed and baselinesWritten before treating this as a full suite result.
1At least one test failed.Read its failure and evidence before changing the app or test.
2Nothing ran, something could not be checked, or run-level output or required work failed.Read the run, file and test failures; fix the reported problem.
130Stopped by SIGINT, usually Ctrl+C, or by a host-provided Failure.Inspect the saved partial work if needed.
143Stopped by SIGTERM.Inspect the saved partial work if needed.

Precedence matters when results are mixed. Interruption wins first. An invalid run request, no tests running, lost output or a required host check waived by skipping produces 2 before test failures are considered.

Otherwise, any failed test gives 1, even beside errors, inconclusive tests, unfinished files or missing recordings. With no failed test, those problems give 2. A selection containing only skipped tests also gives 2 because nothing ran.

SIGINT and SIGTERM let Retest write its result and attempt cleanup. A second signal stops it immediately. SIGKILL cannot produce a final result; inspection reconstructs the events and marks the run incomplete.

Failure classes Link to Failure classes

Failures have class and message, with optional location and details. The class identifies the problem; its position in a run or test and any other failures determine the final exit code.

ClassMeaning
check_failedAn ordinary assertion failed.
host_check_failedA page check required by the host or a strict diagnostics policy failed.
not_foundA required locator match did not appear.
ambiguousA call needing one element found several.
not_actionableThe element could not receive the requested input.
timeoutA test or operation exceeded its budget.
session_lostThe browser or session disappeared.
outcome_unknownInput may have reached the app, but its effect could not be established.
setup_failedA target, server, session or required preparation could not be set up.
cleanup_failedRequired cleanup did not finish successfully.
collection_failedA file could not declare its tests successfully.
test_errorTest code threw or violated the execution protocol.
no_assertionsA test ended without making an assertion.
not_awaitedA call was left unawaited or unfinished.
concurrent_commandsTwo operations tried to use the same app incompatibly.
unsupportedThe selected platform cannot perform the requested operation.
usageAn argument, configuration or selection was invalid.
interruptedThe run or operation was stopped from outside.
reporting_failedA reporter or required output failed, requireComplete found incomplete diagnostics, or a strict diagnostics rule could not judge.
evaluation_failedA required AI check judged a criterion false.
evaluation_inconclusiveA required AI check could not decide from the evidence.
evaluation_errorAn AI check could not obtain a valid judgement.
evidence_incompleteRequired capture or recording evidence was incomplete.

The primary failure appears in failure. Additional failures may appear in failure.details.also, while cleanup failures have their own array. A later cleanup problem does not replace an earlier check failure.

Attempt endings Link to Attempt endings

ending.kind identifies what ended an attempt. It separates a failed intended check from an action or setup that stopped the test before that check ran. checkId names a required check when available; notRun lists required host checks that never ran.

KindWhat ended the attempt
passedChecks passed.
skippedA declaration skipped the test.
not_runThe attempt never started.
assertion_failedA check in the test failed.
required_check_failedA host-required check failed.
check_errorThe parent could not complete a required check.
inconclusiveA required AI judgement was undecided.
evaluation_errorThe AI evaluation could not complete correctly.
setup_failedSetup or preparation failed.
action_failedAn action failed before a check settled the result.
timed_outThe test ran out of time.
test_errorTest code or its protocol failed.
crashedThe browser was lost or the test process ended on its own.
cancelledThe run stopped the attempt.
outcome_unknownA dispatched action never produced a known outcome.
cleanup_failedCleanup alone prevented a clean ending.

AI check verdicts Link to AI check verdicts

VerdictMeaning
passEvery criterion passed.
failAt least one criterion failed.
inconclusiveNone failed, but at least one remained undecided.
errorThe check could not obtain a valid judgement.
cancelledThe check was stopped.
not_runThe required check never ran.

Individual criteria use only pass, fail and inconclusive. A required check affects the test even if its promise is caught. An advisory check records its result without making the test fail. See AI checks for evidence rules.

Evidence and capture states Link to Evidence and capture states

Recording evidence has its own evidenceStatus.state, separate from the observed test status. Missing recordings do not rewrite a passed test as failed. When recordings are required, their absence prevents the run from passing.

Evidence stateMeaning
completeRequested evidence was kept without a reported gap.
partialSome evidence was kept, with losses described in gaps.
unavailableRequested evidence could not be obtained.
not_requestedNo evidence of this kind was requested. The field may instead be absent.

Console and network capture each use complete, partial, unavailable or disabled. Complete capture with zero records means nothing occurred within the declared scope. Unavailable capture does not establish that the app was quiet.

Result fields Link to Result fields

Run fieldContents
schemaVersion, runId, retestVersionSchema version 1, run identity and writer version.
startedAt, finishedAt, durationMsStart and finish timestamps, and elapsed duration.
status, exitCode, completeOverall outcome and completeness.
countspassed, failed, error, notRun and inconclusive counts, plus skipped when present.
browser, browsers, nativesFirst browser or null, and configured browser or native execution identities when present.
failureA run-level problem that no one test explains.
narrowed, baselinesWrittenFocused selection and baseline writes when applicable.
evidenceStatusRun-wide recording evidence state, requirement and attempt counts.
filesFile results with file, collection status, optional failure and tests.
Test fieldContents
testId, name, file, location, describePathStable test identity and source, with optional group path.
variant, variantKeyApp-to-target choices and their printable identity when configured.
setuptrue for a setup result.
attemptId, status, durationMs, assertionCountThis attempt's identity and observed outcome.
failure, cleanupFailuresPrimary failure and separate cleanup problems.
hostChecks, evaluationsHost page checks and AI check records.
executionBundle, configuration, runtime, sessions, starting state and available host identities.
preparations, cleanups, endingHost preparation and cleanup records, and the attempt's ending.
diagnosticsCapture summaries and artefact paths by session.
recordings, evidenceStatusRecordings and their separate evidence state.
evidenceFailure screenshot references with portable paths and available capture identities.

Optional fields can be absent when they do not apply or an older Retest version did not record them. Use Run folder and events for schemas and event identities, or Use Retest from code to consume results directly.

Next steps Link to Next steps