test result returns the outcome of the most recent completed run for a test:
testsprite test result test_3a9f21c7
Add --include-analysis to attach the AI triage block — root-cause hypothesis, recommended fix target, failure kind, and the snapshot ID that ties all artifacts together:
testsprite test result test_3a9f21c7 --include-analysis
The analysis fields are especially useful when piping to an agent:
testsprite test result test_3a9f21c7 --include-analysis --output json \ | jq '{hypothesis: .analysis.rootCauseHypothesis, fix: .analysis.recommendedFixTarget}'
Pass --history to list prior runs instead of the latest result:
testsprite test result test_3a9f21c7 --history
Filter by trigger source or time window:
testsprite test result test_3a9f21c7 --history --source cli --since 7dtestsprite test result test_3a9f21c7 --history --source portal --since 2026-06-10T00:00:00Z
Paginate long histories:
testsprite test result test_3a9f21c7 --history --page-size 10 --cursor <token>
When a test is failed, start with the one-screen triage card:
testsprite test failure summary test_3a9f21c7
This prints the status, failure kind, root-cause hypothesis, and recommended fix target — everything you need to decide what to do next, without downloading anything.To pull the full failure bundle to disk:
testsprite test failure get test_3a9f21c7 --out ./.testsprite/failure
The bundle is one self-consistent, run-scoped package — failing step, DOM snapshots as text, test source, and root-cause analysis, all anchored to one snapshotId. See Failure Bundle for the full contents.Add --failed-only to keep only the failing step and its neighbors (±1), trimming the bundle for faster agent context loading:
testsprite test failure get test_3a9f21c7 --out ./.testsprite/failure --failed-only
test failure get always returns the latest failing run for a test — that pointer moves if a new run comes in. When multiple runs might be in flight simultaneously, pin to an exact run with test artifact get:
testsprite test artifact get run_5c1d9a2b --out ./.testsprite/runs/run_5c1d9a2b
The artifact bundle for a specific run is immutable — a concurrent Portal or schedule run cannot overwrite it. This is the safe path for agents and CI pipelines where two runs of the same test might overlap.
Use test failure get <test-id> for the interactive triage loop. Use test artifact get <run-id> in scripts and CI where you need a stable, run-scoped bundle that a concurrent run can’t shift under you.
The default output directory is ./.testsprite/runs/<run-id>/. The parent directory must exist before you run the command.
testsprite test code get test_3a9f21c7 --out ./tests/checkout_flow.py
The response includes the language, framework, code content, and the codeVersion token — useful if you plan to update the code with testsprite test code put and want protection against overwriting a concurrent edit.