Test Engine

Access data from Test Engine.


List the test runs of a commit #

GET /ci/{owner}/repositories/{repository}/tests/runs

Returns every name test results arrived under for the commit, with the runs received under it -- one per leg or shard -- how they were sent, and whether they arrived whole; and whether the repository accepts test results at all. Read from Test Engine's own data only: a CI job missing from the list sent nothing Mergify received.

Admin Application Key CI Application Key MergifyTokenBearerAuth GitHub Token
repository string required

The name of the repository

min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$

owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

head_sha string required

The full SHA of the commit whose test runs to list.

pattern: ^[0-9a-fA-F]{40}$

200 Successful Response
head_shastringrequired

The commit the results were sent for.

test_results_ingestion"enabled" | "not_enabled" | "paused"required

Whether Mergify accepts test results for this repository: `not_enabled` when CI Insights is not enabled on it, so every upload is refused; `paused` when ingestion is paused for its organization.

Enum: enabled not_enabled paused
pending_uploadsintegerrequired

Uploads to this repository still waiting to be ingested that arrived since this commit's first test run began, from this commit or another, counted up to 5000.

jobsJobTestRuns[]required

Every name test results arrived under for this commit. A CI job missing here sent nothing Mergify received: check in the CI provider whether it ran.

pipeline_namestring | nullrequired

The pipeline name the results were sent under.

job_namestring | nullrequired

The job name the results were sent under: `MERGIFY_TEST_JOB_NAME` when set, else the provider's own job name (on GitHub Actions the job id, not its displayed name).

test_results"results_received" | "upload_error" | "ingesting"required

`results_received` when every run received so far arrived whole; `upload_error` when a run arrived incomplete or unreadable; `ingesting` while part of a run is still waiting to be ingested.

Enum: results_received upload_error ingesting
test_runsTestRun[]required

The runs of the job's latest CI run, every attempt, in the order they ended: one per leg or shard, plus any re-run beside the run it repeats.

job_legstring | nullrequired

The leg of a matrix or sharded job the run named, when the client names one; no released client does yet.

run_attemptinteger | nullrequired

The CI run attempt that sent the results, when the provider has one.

frameworkstring | nullrequired

The test framework, such as `pytest`.

framework_versionstring | nullrequired

The version of the test framework.

uploaderTestRunUploaderrequired
method"plugin" | "report" | "unknown"required

How the results were sent: `plugin` for a test framework plugin, `report` for a report file converted by `mergify ci junit-process`, `unknown` when the upload did not say.

Enum: plugin report unknown
namestring | nullrequired

The client that sent the results, as it named itself.

versionstring | nullrequired

The version of that client, as it reported it.

testsintegerrequired

How many test results were received.

failedintegerrequired

How many of them failed.

skippedintegerrequired

How many of them were skipped.

dropped_testsintegerrequired

Test results the upload said it left out, or that could not be stored.

ingestion"complete" | "in_progress" | "incomplete"required

`complete` when no part the upload declared is missing and none was left out or unreadable; `in_progress` while declared parts are missing but uploads to the repository that arrived around the run are still waiting to be ingested; `incomplete` when parts are missing, unreadable or were left out.

Enum: complete in_progress incomplete
ended_atstring <date-time>required

When the test run ended.

Example Response
                          {
  "head_sha": "string",
  "test_results_ingestion": "enabled",
  "pending_uploads": 0,
  "jobs": [
    {
      "pipeline_name": "string",
      "job_name": "string",
      "test_results": "results_received",
      "test_runs": null
    }
  ]
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/tests/runs" \
  -H "Authorization: Bearer <token>"

Search tests #

GET /ci/{owner}/repositories/{repository}/search/tests

Search tests in a repository.

Admin Application Key MergifyTokenBearerAuth GitHub Token
repository string required

The name of the repository

min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$

owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

test_name string[]

Filter by test name. Pass multiple times to combine matches. Supports glob patterns (`*`, `?`). Omit to return all test identities.

test_name_exclude string[]

The test name to exclude

pipeline_name string[]

The pipeline name to filter on

pipeline_name_exclude string[]

The pipeline name to exclude

job_name string[]

The job name to filter on

job_name_exclude string[]

The job name to exclude

health_status ("healthy" | "flaky" | "broken")[]

The health status to filter on

health_status_exclude ("healthy" | "flaky" | "broken")[]

The health status to exclude

failed_executions_impact ("low" | "medium" | "high")[]

The failed executions impact to filter on

failed_executions_impact_exclude ("low" | "medium" | "high")[]

The failed executions impact to exclude

state TestStateValue[]

The states to filter on.

state_exclude TestStateValue[]

The states to exclude.

is_quarantined boolean

Deprecated: use `state=quarantined` or `state_exclude=quarantined` instead. Only return tests whose branch, pipeline and job a quarantine covers (`true`) or does not (`false`). Omit to return both.

cursor string

The opaque cursor of the current page. Must be extracted from RFC 5988 pagination links to get the previous/next pages

per_page integer

The number of items per page

min: 1 · max: 100

sort "executions_count" | "test_name" | "pipeline_name" | "job_name" | "health_status" | "state" | "failed_executions_impact" | "failed_executions_ratio"

Sort field

direction "asc" | "desc"

Sort direction

200 Successful Response
sizeintegerrequired

The number of items in this page

per_pageintegerrequired

The number of items per page

testsTestSearchResult[]required

Test identities matching the search query.

test_idstring <uuid5>required

Stable identifier of the test. Pass it to the per-test endpoints to fetch details, metrics, or failures.

test_namestringrequired

Fully qualified name of the test as reported by the CI provider.

pipeline_namestringrequired

Name of the pipeline (workflow) that ran the test.

job_namestringrequired

Name of the job within the pipeline that ran the test.

stateTestStateValue | nullrequired

The state this test identity is put in for its branch, pipeline and job. `null` when it is in none.

health_status"healthy" | "flaky" | "broken"required

Current health classification of the test: healthy, flaky, or broken.

Enum: healthy flaky broken
failed_executions_impact"low" | "medium" | "high" | nullrequired

Impact of the test's failures, derived from its failure ratio. `null` for healthy tests, which have no meaningful failure impact.

totalintegerrequired

Total number of test identities matching the search query, across all pages.

Example Response
                          {
  "size": 0,
  "per_page": 0,
  "tests": [
    {
      "test_id": "string",
      "test_name": "string",
      "pipeline_name": "string",
      "job_name": "string",
      "state": "quarantined",
      "health_status": "healthy",
      "failed_executions_impact": "low"
    }
  ],
  "total": 0
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/search/tests" \
  -H "Authorization: Bearer <token>"

Get detailed information about a test #

GET /ci/{owner}/repositories/{repository}/tests/{test_id}

Get detailed information about a test.

Admin Application Key MergifyTokenBearerAuth GitHub Token
test_id string <uuid5> required

ID of the test

repository string required

The name of the repository

min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$

owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

pipeline_name string

Only read the test's executions in this pipeline. Omit to read them across every pipeline.

min length: 1 · max length: 255

job_name string

Only read the test's executions in this job. Omit to read them across every job.

min length: 1 · max length: 255

200 Successful Response
repositorystringrequired
test_namestringrequired
test_idstring <uuid5>required
health_statusstringrequired
last_conclusionstring | nullrequired
failure_rationumberrequired
flakiness_rationumberrequired
success_rationumberrequired
flaky_detection_enabledbooleanrequired
first_failure_atstring <date-time> | nullrequired
first_failure_commitstring | nullrequired
first_failure_pullGetTestDetailsResponsePull | nullrequired
idintegerrequired
numberintegerrequired
titlestringrequired
userGetTestDetailsResponseUserrequired
idintegerrequired
loginstringrequired
avatar_urlstring | nullrequired

The account's avatar URL, as GitHub reports it. Null when it is not known.

last_failure_atstring <date-time> | nullrequired
last_success_atstring <date-time> | nullrequired
test_frameworkstring | nullrequired
test_framework_versionstring | nullrequired
test_programming_languagestring | nullrequired
test_filepathstring | nullrequired
test_function_namestring | nullrequired
Example Response
                          {
  "repository": "string",
  "test_name": "string",
  "test_id": "string",
  "health_status": "string",
  "last_conclusion": "string",
  "failure_ratio": 0,
  "flakiness_ratio": 0,
  "success_ratio": 0,
  "flaky_detection_enabled": true,
  "first_failure_at": "2024-01-15T09:00:00Z",
  "first_failure_commit": "string",
  "first_failure_pull": {
    "id": 0,
    "number": 0,
    "title": "string",
    "user": {
      "id": 0,
      "login": "string",
      "avatar_url": "string"
    }
  },
  "last_failure_at": "2024-01-15T09:00:00Z",
  "last_success_at": "2024-01-15T09:00:00Z",
  "test_framework": "string",
  "test_framework_version": "string",
  "test_programming_language": "string",
  "test_filepath": "string",
  "test_function_name": "string"
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/tests/:test_id" \
  -H "Authorization: Bearer <token>"

Get a single test stat as a time series #

GET /ci/{owner}/repositories/{repository}/tests/{test_id}/stats/{stat}

Return one of the test stats over the requested window, one point per UTC day, with a summary value over the full window.

Admin Application Key MergifyTokenBearerAuth GitHub Token
test_id string <uuid5> required

ID of the test

stat "success_count" | "failure_count" | "flaky_count" | "mean_duration" required
repository string required

The name of the repository

min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$

owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

window "7d" | "30d"

Period to cover: the last 7 or 30 UTC days, today included. Plans without 30-day CI Insights retention always get the last 7 days.

pipeline_name string

Only read the test's executions in this pipeline. Omit to read them across every pipeline.

min length: 1 · max length: 255

job_name string

Only read the test's executions in this job. Omit to read them across every job.

min length: 1 · max length: 255

200 Successful Response
Discriminated by stat — 4 types
success_countTestCountStatsResponse
valueintegerrequired
value_over_time_TestStatsBucket_int_[]required
startstring <date-time>required
endstring <date-time>required
valueintegerrequired
stat"success_count" | "failure_count" | "flaky_count"required
Enum: success_count failure_count flaky_count
failure_countTestCountStatsResponse
valueintegerrequired
value_over_time_TestStatsBucket_int_[]required
startstring <date-time>required
endstring <date-time>required
valueintegerrequired
stat"success_count" | "failure_count" | "flaky_count"required
Enum: success_count failure_count flaky_count
flaky_countTestCountStatsResponse
valueintegerrequired
value_over_time_TestStatsBucket_int_[]required
startstring <date-time>required
endstring <date-time>required
valueintegerrequired
stat"success_count" | "failure_count" | "flaky_count"required
Enum: success_count failure_count flaky_count
mean_durationTestDurationStatsResponse
valuenumberrequired
value_over_time_TestStatsBucket_float_[]required
startstring <date-time>required
endstring <date-time>required
valuenumberrequired
statstringrequired
Example Response
                          {
  "value": 0,
  "value_over_time": [
    {
      "start": "2024-01-15T09:00:00Z",
      "end": "2024-01-15T09:00:00Z",
      "value": 0
    }
  ],
  "stat": "success_count"
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/tests/:test_id/stats/:stat" \
  -H "Authorization: Bearer <token>"

Get a test's health transitions over time #

GET /ci/{owner}/repositories/{repository}/tests/{test_id}/health-transitions

Return the moments a test's health (healthy/flaky/broken) changed over the requested window: the edges of the series, not the full series. The first point is the health where the window opens, at `first_activity_at`; each later one is the run at which the test turned flaky or broken, or recovered. Without a pipeline and job, the worst health across the test's jobs wins at each instant.

Admin Application Key MergifyTokenBearerAuth GitHub Token
test_id string <uuid5> required

ID of the test

repository string required

The name of the repository

min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$

owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

window "7d" | "30d" | "90d"

Period to cover: the last 7, 30 or 90 UTC days, today included.

pipeline_name string

Only read the test's executions in this pipeline. Omit to read them across every pipeline.

min length: 1 · max length: 255

job_name string

Only read the test's executions in this job. Omit to read them across every job.

min length: 1 · max length: 255

200 Successful Response
transitionsHealthTransition[]required

Health changes over the window, oldest first. Consecutive entries always differ; the first entry is the health at `first_activity_at`. Without a pipeline and job, the worst health across the test's jobs wins at each instant.

atstring <date-time>required

Run at which the test's health changed to `health_status`, or `first_activity_at` for the first point.

health_status"healthy" | "flaky" | "broken"required

Health the test held from `at` until the next transition.

Enum: healthy flaky broken
exception_typestring | null

Exception raised by the run that opened this transition. Always null for a recovery, for the first point, when that run passed (a flaky test can turn flaky on a pass), and when the run is no longer retained.

pull_requestGetTestDetailsResponsePull | null

Pull request whose merge commit the run that opened this transition ran on. Null in three cases: on a recovery, because a test can stop failing without a PR fixing it and no 'fixed by' is attributed; when that commit cannot be traced back to a merged pull request; and on the first point.

idintegerrequired
numberintegerrequired
titlestringrequired
userGetTestDetailsResponseUserrequired
idintegerrequired
loginstringrequired
avatar_urlstring | nullrequired

The account's avatar URL, as GitHub reports it. Null when it is not known.

first_activity_atstring <date-time> | nullrequired

The test's first run in the window, the window start when it also ran before, or null when it had no activity. A consumer can treat a `first_activity_at` well after the window start as the test's genuine origin, and one at the window edge as history that predates the retained window.

Example Response
                          {
  "transitions": [
    {
      "at": "2024-01-15T09:00:00Z",
      "health_status": "healthy",
      "exception_type": "string",
      "pull_request": {}
    }
  ],
  "first_activity_at": "2024-01-15T09:00:00Z"
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/tests/:test_id/health-transitions" \
  -H "Authorization: Bearer <token>"

Get test failures #

GET /ci/{owner}/repositories/{repository}/tests/{test_id}/failures

Get test failures.

Admin Application Key MergifyTokenBearerAuth GitHub Token
test_id string <uuid5> required

ID of the test

repository string required

The name of the repository

min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$

owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

pipeline_name string

Only read the test's executions in this pipeline. Omit to read them across every pipeline.

min length: 1 · max length: 255

job_name string

Only read the test's executions in this job. Omit to read them across every job.

min length: 1 · max length: 255

200 Successful Response
failuresTestFailure[]required
idstring <uuid5>required
exception_typestringrequired
exception_messagestringrequired
failure_countintegerrequired
first_failure_atstring <date-time>required
last_failure_atstring <date-time>required
Example Response
                          {
  "failures": [
    {
      "id": "string",
      "exception_type": "string",
      "exception_message": "string",
      "failure_count": 0,
      "first_failure_at": "2024-01-15T09:00:00Z",
      "last_failure_at": "2024-01-15T09:00:00Z"
    }
  ]
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/tests/:test_id/failures" \
  -H "Authorization: Bearer <token>"

Get test failure #

GET /ci/{owner}/repositories/{repository}/tests/{test_id}/failures/{failure_id}

Get test failure.

Admin Application Key MergifyTokenBearerAuth GitHub Token
test_id string <uuid5> required

ID of the test

failure_id string <uuid5> required

ID of the failure

repository string required

The name of the repository

min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$

owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

pipeline_name string

Only read the test's executions in this pipeline. Omit to read them across every pipeline.

min length: 1 · max length: 255

job_name string

Only read the test's executions in this job. Omit to read them across every job.

min length: 1 · max length: 255

200 Successful Response
idstring <uuid5>required
exception_typestringrequired
exception_messagestringrequired
failure_countintegerrequired
first_failure_atstring <date-time>required
last_failure_atstring <date-time>required
latest_eventsTestFailureEvent[]required
idstringrequired
failed_atstring <date-time>required
exception_stacktracestring | nullrequired
test_filepathstring | nullrequired
test_programming_languagestring | nullrequired
job_urlstring | null
Example Response
                          {
  "id": "string",
  "exception_type": "string",
  "exception_message": "string",
  "failure_count": 0,
  "first_failure_at": "2024-01-15T09:00:00Z",
  "last_failure_at": "2024-01-15T09:00:00Z",
  "latest_events": [
    {
      "id": "string",
      "failed_at": "2024-01-15T09:00:00Z",
      "exception_stacktrace": "string",
      "test_filepath": "string",
      "test_programming_language": "string",
      "job_url": "string"
    }
  ]
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/tests/:test_id/failures/:failure_id" \
  -H "Authorization: Bearer <token>"

List a test's executions #

GET /ci/{owner}/repositories/{repository}/tests/{test_id}/executions

List the identities under which this test ran over the requested time window, ordered by total executions.

Admin Application Key MergifyTokenBearerAuth GitHub Token
test_id string <uuid5> required

ID of the test

repository string required

The name of the repository

min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$

owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

cursor string

The opaque cursor of the current page. Must be extracted from RFC 5988 pagination links to get the previous/next pages

per_page integer

The number of items per page

min: 1 · max: 100

sort "executions_count" | "pipeline_name" | "job_name"

Sort field

direction "asc" | "desc"

Sort direction

window "7d" | "30d"

Period to cover: the last 7 or 30 UTC days, today included. Plans without 30-day CI Insights retention always get the last 7 days.

200 Successful Response
sizeintegerrequired

The number of items in this page

per_pageintegerrequired

The number of items per page

executionsTestExecutionResult[]required

Test identities under which this test ran over the requested time window, ordered by total executions.

test_idstring <uuid5>required

Stable identifier of the test. Matches the `test_id` in the URL.

test_namestringrequired

Fully qualified name of the test as reported by the CI provider.

pipeline_namestringrequired

Name of the pipeline (workflow) that ran the test.

job_namestringrequired

Name of the job within the pipeline that ran the test.

executions_countintegerrequired

Number of executions of this test under this identity over the requested time window.

Example Response
                          {
  "size": 0,
  "per_page": 0,
  "executions": [
    {
      "test_id": "string",
      "test_name": "string",
      "pipeline_name": "string",
      "job_name": "string",
      "executions_count": 0
    }
  ]
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/tests/:test_id/executions" \
  -H "Authorization: Bearer <token>"

List quarantined tests #

GET /ci/{owner}/repositories/{repository}/quarantines
Deprecated

Deprecated: use the test states API, `/ci/{owner}/repositories/{repository}/test-states`. List the tests currently quarantined in the repository, ordered by `sort` and `direction` (quarantine creation time ascending by default). A quarantine applies to a specific branch or to all branches when `branch` is `null`. Pass `per_page` (and optionally `cursor`) to receive a bounded page with RFC 5988 navigation links. Omitting `per_page` is deprecated: it returns the full list in a single response, flagged with a `Deprecation` header. A future release will return the first page of 10 quarantines instead.

Admin Application Key CI Application Key MergifyTokenBearerAuth GitHub Token
repository string required

The name of the repository

min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$

owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

branch string

Deprecated: use `branch_name`.

min length: 1 · max length: 255

test_id string <uuid>[]

The test identifier to filter on

source ("manual" | "auto")[]

The sources to filter on.

branch_name string[]

The branch name to filter on. Quarantines applying to every branch always match.

branch_name_exclude string[]

The branch name to exclude. Quarantines applying to every branch are kept.

pipeline_name string[]

The pipeline name to filter on. Quarantines applying to every pipeline always match.

pipeline_name_exclude string[]

The pipeline name to exclude. Quarantines applying to every pipeline are kept.

job_name string[]

The job name to filter on. Quarantines applying to every job always match.

job_name_exclude string[]

The job name to exclude. Quarantines applying to every job are kept.

test_name string[]

The test name to filter on

test_name_exclude string[]

The test name to exclude

health_status ("healthy" | "flaky" | "broken")[]

The health status to filter on. Tests with no recent runs are left out.

health_status_exclude ("healthy" | "flaky" | "broken")[]

The health status to exclude. Tests with no recent runs are kept.

cursor string

The opaque cursor of the current page. Must be extracted from RFC 5988 pagination links to get the previous/next pages.

per_page integer

The number of items per page, with RFC 5988 cursor pagination. Omitting it is deprecated: it returns the full list in a single response, and will default to 10 in a future release.

min: 1 · max: 100

sort "created_at" | "test_name" | "pipeline_name" | "job_name" | "health_status" | "source"

Sort field. `test_name` orders by the first 255 characters of the name: names sharing them come back in a stable but arbitrary order.

direction "asc" | "desc"

Sort direction. Ascending `created_at` is oldest first; ascending `health_status` is broken, flaky, healthy, then tests with no recent runs. `pipeline_name` and `job_name` put quarantines applying to every pipeline or job first.

200 Successful Response
sizeintegerrequired

The number of items in this page

per_pageinteger | nullrequired

The number of items per page, or `null` when the endpoint was called without `per_page` and returned the full list in a single response.

quarantined_testsQuarantinedTest[]required
idstring <uuid>required

Unique identifier of the quarantine record.

test_namestringrequired

Fully qualified name of the quarantined test.

test_idstring <uuid>required

Stable identifier of the test, derived from its name. Identical across every quarantine of the same test and matches the `test_id` filter on the list endpoint.

reasonstringrequired

Free-form reason recorded when the test was quarantined.

issue_urlstring | nullrequired

Link to where the fix of the test is tracked, such as an issue. `null` when none was given.

branchstring | nullrequired

Deprecated: use `branch_name`.

branch_namestring | nullrequired

Branch this quarantine applies to. `null` means the test is quarantined on every branch.

pipeline_namestring | nullrequired

Pipeline this quarantine applies to. `null` means the test is quarantined in every pipeline.

job_namestring | nullrequired

Job this quarantine applies to. `null` means the test is quarantined in every job.

created_atstring <date-time>required

UTC timestamp when the test was added to quarantine.

source"manual" | "auto"

How the test got quarantined: `manual` (user action) or `auto` (auto-quarantined).

Enum: manual auto
health_status"healthy" | "flaky" | "broken" | nullrequired

Health of the test, or `null` when it has no recent runs.

is_recoveredbooleanrequired

True when recent runs of this test are healthy, suggesting the test could be unquarantined.

unquarantine_when_healthybooleanrequired

True when Mergify unquarantines this test once it recovers.

totalintegerrequired

Total number of quarantines matching the filters, across all pages.

Example Response
                          {
  "size": 0,
  "per_page": 0,
  "quarantined_tests": [
    {
      "id": "string",
      "test_name": "string",
      "test_id": "string",
      "reason": "string",
      "issue_url": "string",
      "branch": "string",
      "branch_name": "string",
      "pipeline_name": "string",
      "job_name": "string",
      "created_at": "2024-01-15T09:00:00Z",
      "source": "manual",
      "health_status": "healthy",
      "is_recovered": true,
      "unquarantine_when_healthy": true
    }
  ],
  "total": 0
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/quarantines" \
  -H "Authorization: Bearer <token>"

Mark a test as quarantined #

POST /ci/{owner}/repositories/{repository}/quarantines
Deprecated

Deprecated: use the test states API, `/ci/{owner}/repositories/{repository}/test-states`. Add a test to the CI Quarantine for a repository

Admin Application Key MergifyTokenBearerAuth GitHub Token
repository string required

The name of the repository

min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$

owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

test_namestringrequired

The fully qualified name of the test that needs to be quarantined

max length: 10000
reasonstringrequired

Reason for the test being added to the quarantine

max length: 10000
issue_urlstring | null

Link to where the fix of the test is tracked, such as an issue in your issue tracker. Must be an `http` or `https` URL.

branch_namestring | null

Branch name on which the test should be quarantined. If not specified, it will be quarantined on all branches. `branch` is accepted as a deprecated alias.

pipeline_namestring | null

Pipeline in which the test should be quarantined. If not specified, it will be quarantined in all pipelines.

job_namestring | null

Job in which the test should be quarantined. If not specified, it will be quarantined in all jobs.

unquarantine_when_healthyboolean

Unquarantine the test once it recovers, when Mergify no longer detects it as flaky or broken.

branchstring | null

Deprecated: use `branch_name`.

201 Successful Response
idstring <uuid>required

The ID of the created quarantine

Example Response
                          {
  "id": "string"
}
                        
400 `TEST_ALREADY_QUARANTINED`: The test already has a quarantine applying to some of the same runs.
detailstringrequired
error_code"CI_TRACES_UPLOAD_UNUSABLE" | "CONFIGURATION_BRANCH_REFUSED" | "CONFIGURATION_INVALID" | "CONFIGURATION_REFUSED_BY_REPOSITORY_RULES" | "CONFIGURATION_SIGNED_COMMITS_REQUIRED" | "DEFAULT_BRANCH_NOT_FOUND" | "GITHUB_ACCOUNT_SUSPENDED" | "GITHUB_APP_ACCESS_LOST" | "GITHUB_RATE_LIMITED" | "GITHUB_UPSTREAM_REQUEST_FORBIDDEN" | "GITHUB_UPSTREAM_REQUEST_REJECTED" | "GITHUB_UPSTREAM_UNAVAILABLE" | "IP_ALLOW_LIST_NOT_CONFIGURED" | "NO_LOGIN_IN_PROGRESS" | "ORGANIZATION_MEMBERS_ONLY" | "PIPELINE_NAME_TAKEN" | "PIPELINE_NOT_FOUND" | "PIPELINE_RUN_NOT_FOUND" | "PULL_REQUEST_NOT_QUEUED" | "RETRY_RULE_NOT_FOUND" | "SAML_ENFORCEMENT_NOT_AUTHORIZED" | "SETTING_MANAGED_BY_ENV" | "SETUP_ALREADY_DONE" | "SETUP_TOKEN_MISMATCH" | "SUBSCRIPTION_API_UNAVAILABLE" | "SUBSCRIPTION_INACTIVE" | "SUBSCRIPTION_TOKEN_INVALID" | "TEST_ALREADY_QUARANTINED" | "TEST_RETRY_NOT_CONFIGURED" | "TEST_STATE_OVERLAP"
Enum: CI_TRACES_UPLOAD_UNUSABLE CONFIGURATION_BRANCH_REFUSED CONFIGURATION_INVALID CONFIGURATION_REFUSED_BY_REPOSITORY_RULES CONFIGURATION_SIGNED_COMMITS_REQUIRED DEFAULT_BRANCH_NOT_FOUND GITHUB_ACCOUNT_SUSPENDED GITHUB_APP_ACCESS_LOST GITHUB_RATE_LIMITED GITHUB_UPSTREAM_REQUEST_FORBIDDEN GITHUB_UPSTREAM_REQUEST_REJECTED GITHUB_UPSTREAM_UNAVAILABLE IP_ALLOW_LIST_NOT_CONFIGURED NO_LOGIN_IN_PROGRESS ORGANIZATION_MEMBERS_ONLY PIPELINE_NAME_TAKEN PIPELINE_NOT_FOUND PIPELINE_RUN_NOT_FOUND PULL_REQUEST_NOT_QUEUED RETRY_RULE_NOT_FOUND SAML_ENFORCEMENT_NOT_AUTHORIZED SETTING_MANAGED_BY_ENV SETUP_ALREADY_DONE SETUP_TOKEN_MISMATCH SUBSCRIPTION_API_UNAVAILABLE SUBSCRIPTION_INACTIVE SUBSCRIPTION_TOKEN_INVALID TEST_ALREADY_QUARANTINED TEST_RETRY_NOT_CONFIGURED TEST_STATE_OVERLAP
documentation_urlstring
Example Response
                          {
  "detail": "string",
  "error_code": "CI_TRACES_UPLOAD_UNUSABLE",
  "documentation_url": "string"
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X POST "https://api.mergify.com/v1/ci/:owner/repositories/:repository/quarantines" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
  "test_name": "string",
  "reason": "string",
  "issue_url": "string",
  "branch_name": "string",
  "pipeline_name": "string",
  "job_name": "string",
  "unquarantine_when_healthy": false,
  "branch": "string"
}'

Get a quarantined test #

GET /ci/{owner}/repositories/{repository}/quarantines/{quarantine_id}
Deprecated

Deprecated: use the test states API, `/ci/{owner}/repositories/{repository}/test-states`. Retrieve a single quarantined test by its quarantine ID.

Admin Application Key MergifyTokenBearerAuth GitHub Token
quarantine_id string <uuid> required
repository string required

The name of the repository

min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$

owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

200 Successful Response
idstring <uuid>required

Unique identifier of the quarantine record.

test_namestringrequired

Fully qualified name of the quarantined test.

test_idstring <uuid>required

Stable identifier of the test, derived from its name. Identical across every quarantine of the same test and matches the `test_id` filter on the list endpoint.

reasonstringrequired

Free-form reason recorded when the test was quarantined.

issue_urlstring | nullrequired

Link to where the fix of the test is tracked, such as an issue. `null` when none was given.

branchstring | nullrequired

Deprecated: use `branch_name`.

branch_namestring | nullrequired

Branch this quarantine applies to. `null` means the test is quarantined on every branch.

pipeline_namestring | nullrequired

Pipeline this quarantine applies to. `null` means the test is quarantined in every pipeline.

job_namestring | nullrequired

Job this quarantine applies to. `null` means the test is quarantined in every job.

created_atstring <date-time>required

UTC timestamp when the test was added to quarantine.

source"manual" | "auto"

How the test got quarantined: `manual` (user action) or `auto` (auto-quarantined).

Enum: manual auto
health_status"healthy" | "flaky" | "broken" | nullrequired

Health of the test, or `null` when it has no recent runs.

is_recoveredbooleanrequired

True when recent runs of this test are healthy, suggesting the test could be unquarantined.

unquarantine_when_healthybooleanrequired

True when Mergify unquarantines this test once it recovers.

Example Response
                          {
  "id": "string",
  "test_name": "string",
  "test_id": "string",
  "reason": "string",
  "issue_url": "string",
  "branch": "string",
  "branch_name": "string",
  "pipeline_name": "string",
  "job_name": "string",
  "created_at": "2024-01-15T09:00:00Z",
  "source": "manual",
  "health_status": "healthy",
  "is_recovered": true,
  "unquarantine_when_healthy": true
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/quarantines/:quarantine_id" \
  -H "Authorization: Bearer <token>"

Update a quarantined test #

PATCH /ci/{owner}/repositories/{repository}/quarantines/{quarantine_id}
Deprecated

Deprecated: use the test states API, `/ci/{owner}/repositories/{repository}/test-states`. Update the fields sent of a quarantined test; the others keep their value.

Admin Application Key MergifyTokenBearerAuth GitHub Token
quarantine_id string <uuid> required
repository string required

The name of the repository

min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$

owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

issue_urlstring | null

Link to where the fix of the test is tracked, such as an issue in your issue tracker. Must be an `http` or `https` URL. `null` removes the link.

204 No content
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X PATCH "https://api.mergify.com/v1/ci/:owner/repositories/:repository/quarantines/:quarantine_id" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
  "issue_url": "string"
}'

Unquarantine a test #

DELETE /ci/{owner}/repositories/{repository}/quarantines/{quarantine_id}
Deprecated

Deprecated: use the test states API, `/ci/{owner}/repositories/{repository}/test-states`. Unquarantine a test with its quarantine id

Admin Application Key MergifyTokenBearerAuth GitHub Token
quarantine_id string <uuid> required
repository string required

The name of the repository

min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$

owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

200 Successful Response
any
204 No content
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X DELETE "https://api.mergify.com/v1/ci/:owner/repositories/:repository/quarantines/:quarantine_id" \
  -H "Authorization: Bearer <token>"

List test states #

GET /ci/{owner}/repositories/{repository}/test-states

List the states the repository's tests are put in, ordered by `sort` and `direction` (creation time ascending by default). A state applies to the branch, pipeline and job it names, or to every one of them when `null`.

Admin Application Key CI Application Key MergifyTokenBearerAuth GitHub Token
repository string required

The name of the repository

min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$

owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

state TestStateValue[]

The states to filter on.

test_id string <uuid>[]

The test identifier to filter on

source ("manual" | "auto")[]

The sources to filter on.

branch_name string[]

The branch name to filter on. Test states applying to every branch always match.

branch_name_exclude string[]

The branch name to exclude. Test states applying to every branch are kept.

pipeline_name string[]

The pipeline name to filter on. Test states applying to every pipeline always match.

pipeline_name_exclude string[]

The pipeline name to exclude. Test states applying to every pipeline are kept.

job_name string[]

The job name to filter on. Test states applying to every job always match.

job_name_exclude string[]

The job name to exclude. Test states applying to every job are kept.

test_name string[]

The test name to filter on

test_name_exclude string[]

The test name to exclude

health_status ("healthy" | "flaky" | "broken")[]

The health status to filter on. Tests with no recent runs are left out.

health_status_exclude ("healthy" | "flaky" | "broken")[]

The health status to exclude. Tests with no recent runs are kept.

cursor string

The opaque cursor of the current page. Must be extracted from RFC 5988 pagination links to get the previous/next pages

per_page integer

The number of items per page

min: 1 · max: 100

sort "created_at" | "test_name" | "pipeline_name" | "job_name" | "health_status" | "source"

Sort field

direction "asc" | "desc"

Sort direction

200 Successful Response
sizeintegerrequired

The number of items in this page

per_pageintegerrequired

The number of items per page

test_statesTestState[]required
idstring <uuid>required

Unique identifier of the test state.

test_namestringrequired

Fully qualified name of the test.

test_idstring <uuid>required

Stable identifier of the test, derived from its name. Identical across every state of the same test and matches the `test_id` filter on the list endpoint.

stateTestStateValuerequired

The state the test is in for this scope.

reasonstringrequired

Free-form reason recorded when the test was put in this state.

issue_urlstring | nullrequired

Link to where the fix of the test is tracked, such as an issue. `null` when none was given.

branch_namestring | nullrequired

Branch this state applies to. `null` means every branch.

pipeline_namestring | nullrequired

Pipeline this state applies to. `null` means every pipeline.

job_namestring | nullrequired

Job this state applies to. `null` means every job.

created_atstring <date-time>required

UTC timestamp when the test was put in this state.

source"manual" | "auto"required

How the test got this state: `manual` (user action) or `auto` (set by Mergify).

Enum: manual auto
health_status"healthy" | "flaky" | "broken" | nullrequired

Health of the test, or `null` when it has no recent runs.

is_recoveredbooleanrequired

True when recent runs of this test are healthy.

unquarantine_when_healthybooleanrequired

For the `quarantined` state: true when Mergify unquarantines the test once it recovers.

totalintegerrequired

Total number of test states matching the filters, across all pages.

Example Response
                          {
  "size": 0,
  "per_page": 0,
  "test_states": [
    {
      "id": "string",
      "test_name": "string",
      "test_id": "string",
      "state": "quarantined",
      "reason": "string",
      "issue_url": "string",
      "branch_name": "string",
      "pipeline_name": "string",
      "job_name": "string",
      "created_at": "2024-01-15T09:00:00Z",
      "source": "manual",
      "health_status": "healthy",
      "is_recovered": true,
      "unquarantine_when_healthy": true
    }
  ],
  "total": 0
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/test-states" \
  -H "Authorization: Bearer <token>"

Put a test in a state #

POST /ci/{owner}/repositories/{repository}/test-states

Put a test in a state for a branch, pipeline and job.

Admin Application Key MergifyTokenBearerAuth GitHub Token
repository string required

The name of the repository

min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$

owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

stateTestStateValuerequired

The state to put the test in.

test_namestringrequired

The fully qualified name of the test.

max length: 10000
reasonstringrequired

Why the test is put in this state.

max length: 10000
issue_urlstring | null

Link to where the fix of the test is tracked, such as an issue in your issue tracker. Must be an `http` or `https` URL.

branch_namestring | null

Branch the state applies to. Every branch when not specified.

pipeline_namestring | null

Pipeline the state applies to. Every pipeline when not specified.

job_namestring | null

Job the state applies to. Every job when not specified.

unquarantine_when_healthyboolean

For the `quarantined` state: unquarantine the test once it recovers, when Mergify no longer detects it as flaky or broken.

201 Successful Response
idstring <uuid>required

The ID of the created test state.

Example Response
                          {
  "id": "string"
}
                        
403 Forbidden
404 Not found
409 `TEST_STATE_OVERLAP`: The test already has a state applying to some of the same runs.
detailstringrequired
error_code"CI_TRACES_UPLOAD_UNUSABLE" | "CONFIGURATION_BRANCH_REFUSED" | "CONFIGURATION_INVALID" | "CONFIGURATION_REFUSED_BY_REPOSITORY_RULES" | "CONFIGURATION_SIGNED_COMMITS_REQUIRED" | "DEFAULT_BRANCH_NOT_FOUND" | "GITHUB_ACCOUNT_SUSPENDED" | "GITHUB_APP_ACCESS_LOST" | "GITHUB_RATE_LIMITED" | "GITHUB_UPSTREAM_REQUEST_FORBIDDEN" | "GITHUB_UPSTREAM_REQUEST_REJECTED" | "GITHUB_UPSTREAM_UNAVAILABLE" | "IP_ALLOW_LIST_NOT_CONFIGURED" | "NO_LOGIN_IN_PROGRESS" | "ORGANIZATION_MEMBERS_ONLY" | "PIPELINE_NAME_TAKEN" | "PIPELINE_NOT_FOUND" | "PIPELINE_RUN_NOT_FOUND" | "PULL_REQUEST_NOT_QUEUED" | "RETRY_RULE_NOT_FOUND" | "SAML_ENFORCEMENT_NOT_AUTHORIZED" | "SETTING_MANAGED_BY_ENV" | "SETUP_ALREADY_DONE" | "SETUP_TOKEN_MISMATCH" | "SUBSCRIPTION_API_UNAVAILABLE" | "SUBSCRIPTION_INACTIVE" | "SUBSCRIPTION_TOKEN_INVALID" | "TEST_ALREADY_QUARANTINED" | "TEST_RETRY_NOT_CONFIGURED" | "TEST_STATE_OVERLAP"
Enum: CI_TRACES_UPLOAD_UNUSABLE CONFIGURATION_BRANCH_REFUSED CONFIGURATION_INVALID CONFIGURATION_REFUSED_BY_REPOSITORY_RULES CONFIGURATION_SIGNED_COMMITS_REQUIRED DEFAULT_BRANCH_NOT_FOUND GITHUB_ACCOUNT_SUSPENDED GITHUB_APP_ACCESS_LOST GITHUB_RATE_LIMITED GITHUB_UPSTREAM_REQUEST_FORBIDDEN GITHUB_UPSTREAM_REQUEST_REJECTED GITHUB_UPSTREAM_UNAVAILABLE IP_ALLOW_LIST_NOT_CONFIGURED NO_LOGIN_IN_PROGRESS ORGANIZATION_MEMBERS_ONLY PIPELINE_NAME_TAKEN PIPELINE_NOT_FOUND PIPELINE_RUN_NOT_FOUND PULL_REQUEST_NOT_QUEUED RETRY_RULE_NOT_FOUND SAML_ENFORCEMENT_NOT_AUTHORIZED SETTING_MANAGED_BY_ENV SETUP_ALREADY_DONE SETUP_TOKEN_MISMATCH SUBSCRIPTION_API_UNAVAILABLE SUBSCRIPTION_INACTIVE SUBSCRIPTION_TOKEN_INVALID TEST_ALREADY_QUARANTINED TEST_RETRY_NOT_CONFIGURED TEST_STATE_OVERLAP
documentation_urlstring
Example Response
                          {
  "detail": "string",
  "error_code": "CI_TRACES_UPLOAD_UNUSABLE",
  "documentation_url": "string"
}
                        
422 Unprocessable entity
Example Request
curl -X POST "https://api.mergify.com/v1/ci/:owner/repositories/:repository/test-states" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
  "state": "quarantined",
  "test_name": "string",
  "reason": "string",
  "issue_url": "string",
  "branch_name": "string",
  "pipeline_name": "string",
  "job_name": "string",
  "unquarantine_when_healthy": false
}'

Get a test state #

GET /ci/{owner}/repositories/{repository}/test-states/{test_state_id}

Retrieve a single test state by its ID.

Admin Application Key MergifyTokenBearerAuth GitHub Token
test_state_id string <uuid> required
repository string required

The name of the repository

min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$

owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

200 Successful Response
idstring <uuid>required

Unique identifier of the test state.

test_namestringrequired

Fully qualified name of the test.

test_idstring <uuid>required

Stable identifier of the test, derived from its name. Identical across every state of the same test and matches the `test_id` filter on the list endpoint.

stateTestStateValuerequired

The state the test is in for this scope.

reasonstringrequired

Free-form reason recorded when the test was put in this state.

issue_urlstring | nullrequired

Link to where the fix of the test is tracked, such as an issue. `null` when none was given.

branch_namestring | nullrequired

Branch this state applies to. `null` means every branch.

pipeline_namestring | nullrequired

Pipeline this state applies to. `null` means every pipeline.

job_namestring | nullrequired

Job this state applies to. `null` means every job.

created_atstring <date-time>required

UTC timestamp when the test was put in this state.

source"manual" | "auto"required

How the test got this state: `manual` (user action) or `auto` (set by Mergify).

Enum: manual auto
health_status"healthy" | "flaky" | "broken" | nullrequired

Health of the test, or `null` when it has no recent runs.

is_recoveredbooleanrequired

True when recent runs of this test are healthy.

unquarantine_when_healthybooleanrequired

For the `quarantined` state: true when Mergify unquarantines the test once it recovers.

Example Response
                          {
  "id": "string",
  "test_name": "string",
  "test_id": "string",
  "state": "quarantined",
  "reason": "string",
  "issue_url": "string",
  "branch_name": "string",
  "pipeline_name": "string",
  "job_name": "string",
  "created_at": "2024-01-15T09:00:00Z",
  "source": "manual",
  "health_status": "healthy",
  "is_recovered": true,
  "unquarantine_when_healthy": true
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/test-states/:test_state_id" \
  -H "Authorization: Bearer <token>"

Update a test state #

PATCH /ci/{owner}/repositories/{repository}/test-states/{test_state_id}

Update the fields sent of a test state; the others keep their value.

Admin Application Key MergifyTokenBearerAuth GitHub Token
test_state_id string <uuid> required
repository string required

The name of the repository

min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$

owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

issue_urlstring | null

Link to where the fix of the test is tracked, such as an issue in your issue tracker. Must be an `http` or `https` URL. `null` removes the link.

204 No content
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X PATCH "https://api.mergify.com/v1/ci/:owner/repositories/:repository/test-states/:test_state_id" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
  "issue_url": "string"
}'

Remove a test state #

DELETE /ci/{owner}/repositories/{repository}/test-states/{test_state_id}

Take a test out of a state, by the test state's ID.

Admin Application Key MergifyTokenBearerAuth GitHub Token
test_state_id string <uuid> required
repository string required

The name of the repository

min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$

owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

204 No content
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X DELETE "https://api.mergify.com/v1/ci/:owner/repositories/:repository/test-states/:test_state_id" \
  -H "Authorization: Bearer <token>"

Get a single test stat as a time series #

GET /ci/{owner}/repositories/{repository}/tests/stats/{stat}

Return one test stat with a window summary `value` and a per-day `value_over_time` series of failed executions.

Admin Application Key MergifyTokenBearerAuth GitHub Token
stat "total_tests" | "healthy_tests" | "broken_tests" | "flaky_tests" | "failed_executions" | "median_test_run_duration" required
repository string required

The name of the repository

min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$

owner string required

The owner of the repository

min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$

test_name string[]

The test name to filter on

test_name_exclude string[]

The test name to exclude

job_name string[]

The job name to filter on

job_name_exclude string[]

The job name to exclude

pipeline_name string[]

The pipeline name to filter on

pipeline_name_exclude string[]

The pipeline name to exclude

failed_executions_impact ("low" | "medium" | "high")[]

The failed executions impact to filter on

failed_executions_impact_exclude ("low" | "medium" | "high")[]

The failed executions impact to exclude

200 Successful Response
stat"total_tests" | "healthy_tests" | "broken_tests" | "flaky_tests" | "failed_executions" | "median_test_run_duration"required
Enum: total_tests healthy_tests broken_tests flaky_tests failed_executions median_test_run_duration
valueintegerrequired
value_over_timeTestStatBucket[]required
startstring <date-time>required
endstring <date-time>required
valueintegerrequired
Example Response
                          {
  "stat": "total_tests",
  "value": 0,
  "value_over_time": [
    {
      "start": "2024-01-15T09:00:00Z",
      "end": "2024-01-15T09:00:00Z",
      "value": 0
    }
  ]
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/tests/stats/:stat" \
  -H "Authorization: Bearer <token>"

Was this page helpful?