Retry the failed cases of a run
Code Mode: praxis.devops.testRuns.retryFailed
HTTP: POST /devops/v1/test-runs/{id}:retryFailed
Run again only the cases that did not pass in a run. The answer is a NEW run, queued with trigger retry and retryOf naming the original, whose selection holds exactly the non-passed cases — so a long plan is not paid for twice after a fix, and the original run keeps its own result as the record of what failed. Use it when you know which failure you repaired; create a run of the plan when the selection itself should change. A run holding no non-passed execution is refused with INVALID_SELECTOR, and a run that is still going is retried from the failures it has recorded so far rather than waited for.
签名
praxis.devops.testRuns.retryFailed(args:{path:{/** e.g. "trn_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string}}):Promise<{/** Run identifier used for later reads, cancellations and execution listings. e.g. "trn_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string;/** The resource type of this answer, always test_run; use it to tell answers apart when several kinds are handled together. */ object:"test_run";/** RFC 3339 UTC time the run was created, which is when its selection was fixed. e.g. "2026-11-03T09:00:00Z" */ createTime:string;/** RFC 3339 UTC time the run's state or counts last changed. e.g. "2026-11-03T09:12:00Z" */ updateTime:string;/** Canonical Console link for this run, for putting a human-readable reference in a card or a message. e.g. "https://console.deepraxis.com/devops/tests/runs/trn_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ viewerUrl:string;/** The project this run belongs to, from the project list or create answer. e.g. "dvp_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ project:string;/** The plan that selected this run's cases; absent for a run created with an ad-hoc selector. e.g. "tpl_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ plan:string;/** What started this run, which is how a run is attributed back to the event that wanted it. e.g. "manual" */ trigger:"manual"|"pull_request"|"merge_group"|"promotion"|"schedule"|"retry"|"fix_attempt";ref:{/** Branch the commit was reached through, for display and attribution; it does not pin the run, the commit does. e.g. "main" */ branch?:string;/** Full 40-character commit sha the run tested, which is what its result is evidence about. e.g. "4f2a9c1d8e7b6a5c4d3e2f1a0b9c8d7e6f5a4b3c" */ commit:string;/** The proposed change whose testing started this run; absent for runs started by a schedule or by hand. e.g. "pr_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ pullRequest?:string;/** Commit at the head of the group being landed together, when the run tested a merged candidate rather than one change. e.g. "5a3b0d2e9f8c7b6a5d4e3f2a1b0c9d8e7f6a5b4c" */ mergeGroupHead?:string;/** The release this run is evidence about; absent unless the run belongs to a release. e.g. "rls_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ release?:string;/** The promotion this run belongs to; absent unless the run was started to guard or observe one. e.g. "prm_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ promotion?:string};/** The environment the run executed against; absent when the run needed none. e.g. "dve_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ environment:string;/** Where the cases actually ran. e.g. "external" */ executor:"cloud"|"external";selection:{selector:{/** Keep only cases of these declared sizes; omit to allow every size. e.g. ["small","medium"] */ sizes?:Array<"small"|"medium"|"large">;/** Keep only cases carrying at least one of these purpose tags; omit to allow every purpose. e.g. ["regression"] */ purposes?:Array<"smoke"|"regression"|"acceptance"|"contract"|"performance">;/** Keep only cases from these test frameworks; omit to allow every framework. e.g. ["bun"] */ frameworks?:Array<"gherkin"|"bun"|"vitest"|"jest"|"pytest"|"go"|"playwright">;/** Keep only cases carrying every one of these tags; use it to narrow to an area without naming each case. e.g. ["devops"] */ allTags?:Array<string>;/** Keep only cases carrying at least one of these tags; use it to widen across neighbouring areas. e.g. ["api","cli"] */ anyTags?:Array<string>;/** Keep only cases in these repository packages; the package is the directory the file lives in. e.g. ["services/devops"] */ packages?:Array<string>;/** Run exactly these cases, named by id; use it to re-run a known failure without widening to its whole area. e.g. [] */ cases?:Array<string>;/** True keeps only cases declared safe to run against a production environment; use it for a plan whose environment is production. e.g. false */ prodSafeOnly?:boolean;/** Present to select only the cases a commit range can affect, the way a presubmit wants it. */ affected?:{/** The commit the change is measured against; the affected set is what changed between this commit and the run's own commit. e.g. "4f2a9c1d8e7b6a5c4d3e2f1a0b9c8d7e6f5a4b3c" */ base?:string}};/** How many cases the run selected; compare it with the catalog's case count when a run looks too small. e.g. 34 */ selectedCount:number;/** Which rule produced this set — a plan's selector, an explicit list, or the affected set of a commit range. e.g. "plan" */ reason:"affected"|"plan"|"explicit";/** What the affected selection reacted to — the changed packages, files or cases; present only when reason is affected. e.g. ["packages/praxis/rpc-kit"] */ affectedBy?:Array<string>};/** How many times each selected case ran in this run; more than one means a flake can be told apart from a real failure. e.g. 1 */ repeat:number;/** How far the run has got, from being queued to being finished; finished is the only state where the result is final. e.g. "finished" */ state:"queued"|"provisioning"|"running"|"reporting"|"finished";/** The verdict. e.g. "failed" */ result:"pending"|"passed"|"failed"|"errored"|"cancelled"|"timed_out"|"no_tests";counts:{/** Executions that passed, counting a case that passed on a retry as passed. e.g. 30 */ passed:number;/** Executions that failed and counted against the run; quarantined failures are not included here. e.g. 2 */ failed:number;/** Executions that failed and then passed on a retry inside this run. e.g. 1 */ flaky:number;/** Selected executions the tool reported as skipped; they neither pass nor fail the run. e.g. 0 */ skipped:number;/** Selected executions that have not reported yet, which is why a run may still change its result. e.g. 1 */ pending:number;/** Executions reported under a status outside the known set, kept visible instead of being folded into passed or failed. e.g. 0 */ other:number;/** Failures from quarantined cases; they are recorded but do not fail the run, so they explain a failed case that did not fail the verdict. e.g. 1 */ quarantinedFailures:number};/** The external tool that produced the results, present for runs whose results arrived as an uploaded report. */ tool?:{/** Name of the tool that ran the cases, as the uploader declared it. e.g. "playwright" */ name?:string;/** Version of that tool, when the uploader declared one; absent otherwise. e.g. "1.48.0" */ version?:string};/** How many parallel pieces the run's cases were split into, which bounds how long the run takes. e.g. 1 */ shards:number;requestedBy:{/** What sort of actor this is, which decides how the id should be read. e.g. "user" */ kind:"user"|"agent"|"system";/** Identifier of the actor within its kind, such as a user id for a person. e.g. "usr_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string;/** Display name for the actor at the time, so a record reads the way it did when it was written; absent when none was known. e.g. "Sean" */ label?:string};/** The earlier run this one re-runs cases from; absent unless the trigger is a retry. e.g. "trn_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ retryOf?:string;/** RFC 3339 UTC time execution actually began; absent while the run is still queued. e.g. "2026-11-03T09:01:00Z" */ startTime?:string;/** RFC 3339 UTC time the run stopped, whether it finished, failed, was cancelled or timed out; absent while it is still going. e.g. "2026-11-03T09:12:00Z" */ endTime?:string;/** Why the run was cancelled, as given by whoever cancelled it; present only for cancelled runs. e.g. "superseded by trn_01JQ8Z3M9K4V7B2N6C5X0YTRHX" */ cancelReason?:string;/** What the executor reported when the run errored; present only for errored runs, and it concerns the run, not the cases. e.g. "executor lost before reporting shard 2" */ errorMessage?:string;/** Present only when the read asked to expand failedExecutions; it lists this run's non-passed executions so a second call is not needed. */ failedExecutions?:Array<{/** The run this execution belongs to, from the run list or create answer. e.g. "trn_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ run:string;/** The case that was executed, retrievable with a case read for its declaration and state. e.g. "tc_9f2b1c0d8e7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c" */ case:string;/** The case's title as it read when this run executed it, which may predate a later rename. e.g. "a route the table does not name is a 404 and never reaches the service" */ title:string;/** The repository package the executed case lives in. e.g. "services/devops" */ package:string;/** Path of the file that declared the case, relative to the repository root. e.g. "services/devops/spec/features/http-face/http-face.feature" */ file?:string;/** How this execution ended. e.g. "failed" */ status:"passed"|"failed"|"skipped"|"pending"|"other"|"timed_out"|"cancelled";/** True when the case failed and then passed on a retry inside the same run — the fact behind the run's flaky count. e.g. false */ flaky:boolean;/** True when the case was quarantined at the time of the run, so its failure was recorded but did not fail the verdict. e.g. false */ quarantined:boolean;/** How long the case took in milliseconds, summed over its attempts. e.g. 412 */ durationMs:number;/** Every attempt this case took, in order; more than one is what a retry or a flake looks like. */ attempts:Array<{/** Which try this was, counting from 1. e.g. 1 */ attempt:number;/** How this try ended, using the same vocabulary as the execution it belongs to. e.g. "failed" */ status:"passed"|"failed"|"skipped"|"pending"|"other"|"timed_out"|"cancelled";/** How long this try took in milliseconds. e.g. 380 */ durationMs:number;/** The failure message for this try; absent when it did not fail. e.g. "expected 404, received 400" */ message?:string;/** Diagnostic text for this try, such as a stack trace; absent when none was reported. e.g. "at Object.<anonymous> (http-face.steps.ts:57:3)" */ trace?:string;/** RFC 3339 UTC time this try began; absent when the tool reported no timing. e.g. "2026-11-03T09:04:00Z" */ startTime?:string}>;/** The failure message the tool reported, as written; absent for executions that did not fail. e.g. "expected 404, received 400" */ message?:string;/** The step that failed, when the tool identifies one; absent for tools that report only a message. e.g. "Then the answer is HTTP 404" */ failedStep?:string;/** Stack trace or equivalent diagnostic text; absent when the tool reported none. e.g. "at Object.<anonymous> (http-face.steps.ts:57:3)" */ trace?:string;/** Files recorded as evidence for this execution, such as screenshots or reports; empty when the tool attached none. */ evidence:Array<{/** File name as the producing tool wrote it, for display when listing evidence. e.g. "http-face-404.png" */ name:string;/** Media type of the stored file, which decides whether it can be shown inline. e.g. "image/png" */ contentType:string;/** Identifier of the stored file, used to fetch its contents through the file API. e.g. "file_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ fileId:string;/** Size of the stored file in bytes. e.g. 48123 */ size:number}>;/** True when the executed case was not in the catalog at that commit, so a result exists for a case the project no longer knows; it is surfaced rather than dropped e.g. false */ uncatalogued:boolean}>;/** Present only when the run's counts cannot be trusted: they add up to more executions than the cases the run selected, which only happens when a case was counted */ countsUntrusted?:{/** What the disjoint count buckets (passed, failed, skipped, pending, other and quarantined failures) add up to; flaky is not added because it qualifies a case alr e.g. 7539 */ counted:number;/** How many cases the run selected, which is the bound the counts must fit. e.g. 7500 */ selectedCount:number;/** How many executions the counts report beyond the selection; 0 never appears here, since the field itself only appears when the counts are over. e.g. 39 */ overflow:number}}>;参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| id | path | string | 是 | The run identifier returned by a run list or create answer. |
响应
| 状态码 | 内容类型 | 说明 |
|---|---|---|
| 200 | application/json | The new run, queued with the non-passed cases as its selection; its id differs from the run that was retried. |
| 400 | application/json | INVALID_SELECTOR means this run holds no non-passed execution, so there is nothing to retry — it passed, or it recorded no execution yet. Read its executions first; if the selection itself should differ, create a run of the plan instead. |
| 401 | application/json | The API key is missing or invalid; send a valid Praxis API key in the Authorization header before retrying. |
| 403 | application/json | The credential carries no organization, or that organization cannot reach this project; use a key belonging to the project’s organization. No cross-organization read is possible. |
| 404 | application/json | RUN_NOT_FOUND means no run with that id exists in this organization; list the project’s runs and use an id from that answer. A run belonging to another organization reads the same way. |
| 500 | application/json | INTERNAL means the service could not complete the request; retry once, and if it repeats report the request id. A read is safe to repeat; a write that failed this way should be re-read before it is sent again. |