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 → Source Code) 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_coveragetargets). 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.

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.