Test Insights

Access data from Test Insights.


Search tests by name

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

Resolve test identities by name in a repository. Returns one entry per (test_name, pipeline_name, job_name) running on the default branch. Supports glob patterns in `test_name` (e.g. `*test_login*`).

GitHub Token Application Key
repository_name string required

The name of the repository

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

owner string required

The owner of the repository

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

test_name string[] required

Test name to search for. Pass multiple times to combine matches. Supports glob patterns (`*`, `?`).

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

Sort field

direction "asc" | "desc"

Sort direction

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

cursor string

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

per_page integer

The number of items per page

min: 1 · max: 100

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, ordered by total executions.

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.

Example Response

                          {
  "size": 0,
  "per_page": 0,
  "tests": [
    {
      "test_id": "string",
      "test_name": "string",
      "pipeline_name": "string",
      "job_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_name/search/tests" \
  -H "Authorization: Bearer <token>"

Get detailed information about a test

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

Get detailed information about a test.

GitHub Token Application Key
repository_name string required

The name of the repository

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

test_id string <uuid5> required

ID of the test

owner string required

The owner of the repository

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

200 Successful Response
repositorystringrequired
test_namestringrequired
test_idstring <uuid5>required
health_statusstringrequired
last_conclusionstringrequired
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
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"
    }
  },
  "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_name/tests/:test_id" \
  -H "Authorization: Bearer <token>"

List quarantined tests

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

List the tests currently quarantined in the repository, ordered by quarantine creation time ascending. A quarantine applies to a specific branch or to all branches when `branch` is `null`. Pagination is opt-in: pass `per_page` (and optionally `cursor`) to receive a bounded page with RFC 5988 navigation links. Omitting `per_page` returns the full list in a single response — this shortcut exists for backward compatibility and is expected to go away once all callers paginate.

Application Key GitHub Token
owner string required

The owner of the repository

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

repository string required

The name of the repository

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

branch string

min length: 1 · max length: 255

test_id string <uuid>
source "manual" | "auto"
cursor string

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

per_page integer

The number of items per page. Omit to receive the full list in a single response; pass a value to opt into RFC 5988 cursor pagination.

min: 1 · max: 100

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.

reasonstringrequired

Free-form reason recorded when the test was quarantined.

branchstring | nullrequired

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

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
is_recoveredbooleanrequired

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

Example Response

                          {
  "size": 0,
  "per_page": 0,
  "quarantined_tests": [
    {
      "id": "string",
      "test_name": "string",
      "reason": "string",
      "branch": "string",
      "created_at": "2024-01-15T09:00:00Z",
      "source": "manual",
      "is_recovered": 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" \
  -H "Authorization: Bearer <token>"

Get a quarantined test

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

Retrieve a single quarantined test by its quarantine ID.

Application Key GitHub Token
quarantine_id string <uuid> required
owner string required

The owner of the repository

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

repository string required

The name of the repository

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

200 Successful Response
idstring <uuid>required

Unique identifier of the quarantine record.

test_namestringrequired

Fully qualified name of the quarantined test.

reasonstringrequired

Free-form reason recorded when the test was quarantined.

branchstring | nullrequired

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

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
is_recoveredbooleanrequired

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

Example Response

                          {
  "id": "string",
  "test_name": "string",
  "reason": "string",
  "branch": "string",
  "created_at": "2024-01-15T09:00:00Z",
  "source": "manual",
  "is_recovered": 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>"

Was this page helpful?