Flaky tests API

This section documents a deprecated Buildkite API endpoint

Flaky tests should be accessed via the list tests endpoint using the label=flaky query parameter.

The flaky test API endpoint provides information about tests detected as flaky in a test suite.

List all flaky tests

Returns a paginated list of the flaky tests detected in a test suite. Please note that the last_resolved_at field represents a deprecated feature in Test Engine and should not be relied upon.

curl -H "Authorization: Bearer $TOKEN" \
  -X GET "https://api.buildkite.com/v2/analytics/organizations/{org.slug}/suites/{suite.slug}/flaky-tests"
[
  {
    "id": "01867216-8478-7fde-a55a-0300f88bb49b",
    "web_url": "https://buildkite.com/organizations/my_great_org/analytics/suites/my_suite_name/tests/01867216-8478-7fde-a55a-0300f88bb49b",
    "scope": "User#email",
    "name": "is correctly formatted",
    "location": "./spec/models/user_spec.rb:42",
    "file_name": "./spec/models/user_spec.rb",
    "instances": 1,
    "latest_occurrence_at": "2024-07-15T00:07:02.547Z",
    "most_recent_instance_at": "2024-07-15T00:07:02.547Z",
    "last_resolved_at": null,
    "ownership_team_ids": ["4c15a4c7-6674-4585-b592-4adcc8630383", "d30fd7ba-82d8-487f-9d98-6e1a057bcca8"]
  }
]

Optional query string parameters:

search Returns flaky tests with a name or scope that contains the search string. Users with the Ruby test collector installed can also filter results by location.

Example: ?search="User#find_email", ?search="/billing_spec"

branch Returns flaky tests for flakes detected one or more times on the branch whose name is specified by the branch value.

Example: ?branch=main

period Filters the results by the given time period. Valid values are 1hour, 4hours, 1day, 7days, 14days, and 28days. The default period when no period value is specified is 7days.

Example: ?period=28days

Required scope: read_suites

Success response: 200 OK