Skip to main content

run_coverage

Start an execution-coverage run for a build/test target: TestVibe clones the connected repo, builds it, runs its tests with coverage instrumentation, and ingests the resulting report into the coverage snapshot. Returns immediately; the run executes in the background.

warning

Needs a connected source repo (Settings → App Repository) and at least one detected target (run scan_coverage first). One coverage run per project at a time — a second is rejected with 409 conflict.

Request​

POST /api/v1/ops/projects/{project}/coverage/run
ParameterInTypeRequiredDescription
projectpathstringyesThe project's public id.
targetbodyintegernoCoverage target id (see get_coverage → targets). Optional when the project has exactly one target.
curl -X POST -H "Authorization: Bearer $TESTVIBE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"target": 5}' \
"$TESTVIBE_SERVER/api/v1/ops/projects/$PROJECT/coverage/run"

Response​

202 Accepted

{ "coverageRunId": 12, "targetId": 5, "status": "running" }

Poll list_coverage_runs (or get_coverage's runActive) until it leaves running.

testvibe coverage run --wait polls for you, bounded by --timeout <seconds> (default 5400; 0 waits indefinitely; env TESTVIBE_WAIT_TIMEOUT_SECONDS). A wait that ends before the coverage run does exits 3 — no verdict — not 1. See the CLI wait contract.

Errors​

HTTPWhen
400 invalid_requestSeveral targets exist and no target was given.
404 not_foundNo such coverage target in this project.
409 conflictA coverage run is already in progress, no targets detected, or no source repository is connected.

Execution coverage checks credits and storage before starting: 402 insufficient_credits or 507 storage_quota_exceeded can refuse admission. Follow the returned coverageRunId in list_coverage_runs; runActive: false alone is not evidence of success.