MCPcopy Create free account
hub / github.com/TestSprite/testsprite-cli / triggerRunWithMeta

Method triggerRunWithMeta

src/lib/http.ts:262–276  ·  view source on GitHub ↗

* 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 },
  )

Source from the content-addressed store, hash-verified

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

Callers 3

triggerOneFunction · 0.80
runTestRunFunction · 0.80
http.runs.spec.tsFile · 0.80

Calls 1

postWithMetaMethod · 0.95

Tested by

no test coverage detected