* Like `triggerRun` but returns the full `RequestResult` so the caller * can surface the `requestId` in happy-path CLI output. * * `retryOnRateLimit` defaults to `true` so single `test run` and * `test create --run` retain the standard HTTP-layer 429 retry budget. * * Pass `retryOn
(
testId: string,
body: TriggerRunBody,
options: { idempotencyKey: string; signal?: AbortSignal; retryOnRateLimit?: boolean },
)
| 260 | * extra retries per outer attempt, which would multiply POSTs per spec (e.g. 50×3 = 150/min). |
| 261 | */ |
| 262 | async triggerRunWithMeta( |
| 263 | testId: string, |
| 264 | body: TriggerRunBody, |
| 265 | options: { idempotencyKey: string; signal?: AbortSignal; retryOnRateLimit?: boolean }, |
| 266 | ): Promise<RequestResult<TriggerRunResponse>> { |
| 267 | return this.postWithMeta<TriggerRunResponse>(`/tests/${encodeURIComponent(testId)}/runs`, { |
| 268 | body, |
| 269 | headers: { 'idempotency-key': options.idempotencyKey }, |
| 270 | signal: options.signal, |
| 271 | retryOnConflict: false, |
| 272 | // Default true: single `test run` / `test create --run` retain 429 retry. |
| 273 | // Batch call site passes false to keep outer-loop as sole rate-limit owner. |
| 274 | retryOnRateLimit: options.retryOnRateLimit ?? true, |
| 275 | }); |
| 276 | } |
| 277 | |
| 278 | /** |
| 279 | * POST /api/cli/v1/tests/{testId}/runs/rerun |
no test coverage detected