Skip to main content
Use the exit code to gate a job. A launch without waiting can succeed as soon as the server accepts it. Use run --wait, run wait or ci run when the job needs the test verdict. A successful result list or result get exits 0 for any verdict.

Exit codes

Wait timeout (exit 7)

For an ordinary run, the command can return partial JSON with the run IDs, results observed so far and partial: true. Resume the existing execution:
If later integration results have not appeared, a wait can time out even when every listed result has passed. A shared deadline covers all requested executions. run wait also exits 7 when the backend cannot supply whole-execution status. An agent conversation that reached its follow timeout can be resumed with testsprite status --wait.

Unconfirmed run settings

For a project run or ci run, the CLI exits 7 if the receipt fails to confirm the requested URL or environment, or reports concurrency above the requested limit. In JSON errors, error.code is UNSUPPORTED and error.details.field identifies the setting (targetUrl, previewName, environment or maxConcurrency). Inspect the run identified by error.details.runId before retrying. An unconfirmed tunnel also returns UNSUPPORTED. Its error message identifies the tunnel issue.

Interrupts and pipes

An ordinary wait detaches on Ctrl-C. The execution continues and can still incur charges. Stop it explicitly with testsprite run cancel "$RUN_ID". A local run that owns its tunnel requests cancellation of unfinished owned executions by default and closes the tunnel on timeout or interrupt. Read the cancellation outcome before starting another run. With --no-cancel-on-interrupt, the tunnel still closes and remaining steps that need it can fail. A run borrowing a live tunnel can be followed while the owner keeps it open. Cancelling Runs An interrupt can produce both partial JSON on stdout and an INTERRUPTED error with details.signal on stderr. Keep them separate. A closed output pipe is handled without an unhandled EPIPE error.

Error codes

Error output

In JSON mode a command can write diagnostics (such as a request key) as well as an error envelope to stderr. The envelope’s error object includes a machine-readable code and message; when supplied, nextAction, requestId and details explain how to proceed or trace the request. A completed failed run can still write all of its results to stdout.

Statuses

  • test list and test get describe test cases. To look up a case’s latest result, use result list --test <test-id> --limit 1.
  • result list --run <run-id> reports execution progress in run.status (running or finished) and cancellation in run.cancelled. A finished execution can contain failures.
  • Result records use testStatus values such as PASSED, FAILED, BLOCKED, RUNNING or CANCELLED. Include cancelled explicitly in a list’s --status filter to see cancellations. The corresponding verdicts in run wait use lowercase status. Steps in result get use passed, failed or null.

Retrying safely

Pass a consistent --idempotency-key when retrying the same launch. With an unconfirmed project launch, reuse the reported retryIdempotencyKey on the entire original command. Changing the request while keeping its key can produce IDEMPOTENCY_BODY_MISMATCH. If you already have a run ID, run wait follows that execution without starting or charging for another. Output & Scripting