Builds

List tests for a build

List tests for a Buildkite build with execution metrics aggregated over the build's time window. Supports filtering, metric sorting, and pagination. The aggregation window is bounded by the build's lifetime and the organization's maximum Test Engine window. The build is always taken from the URL; a build.id supplied in tags cannot override it.

get/organizations/{org}/builds/{build_id}/tests

Request

  • Base URL: https://api.buildkite.com/v2/analytics
  • URL: https://api.buildkite.com/v2/analytics/organizations/{org}/builds/{build_id}/tests
  • Auth: HTTP bearer

Path parameters

orgstring required

Organization slug

build_idstring uuid required

Build UUID.

Query parameters

labelsstring

Filter by comma-separated test labels. Prefix a label with ! to exclude it, for example flaky,!slow.

pageinteger

Page number for pagination (minimum 1).

per_pageinteger

Results per page for pagination (minimum 1, maximum 100).

branchstring

Filter executions included in the metrics by branch. Prefix with ! to exclude an exact branch or suffix with * to match by prefix, for example !main or feature*. Use at most one operator.

ownersstring

Filter by comma-separated test owner slugs. Prefix an owner with ! to exclude it, for example payments,!platform.

sort_by'duration_avg' | 'duration_sum' | 'duration_min' | 'duration_max' | 'reliability'

Metric used to sort results: duration_avg, duration_sum, duration_min, duration_max, or reliability. Defaults to duration_avg. Metrics cover only executions in the build window.

order'asc' | 'desc'

Sort direction: asc or desc. Defaults to desc.

state'enabled' | 'muted' | 'skipped'

Test state.

Filter by test state: enabled, muted, or skipped.

tagsstring

Filter by comma-separated execution tags in key:value form. Values support ! for exclusion and * for prefix matching. Result values additionally support ~ for any matching execution and ^ for every execution matching, for example framework:!rspec,scm.branch:feature*,result:^passed. A supplied build.id is replaced by the build UUID from the URL.

Response

A list of tests with metrics for the build.

idstring uuid
urlstring uri
web_urlstring uri
scopestring
namestring
locationstring
file_namestring
state'enabled' | 'muted' | 'skipped'

Test state.

state_changed_atstring date-time nullable

When the test entered its current state. Null for enabled tests, which are the default and carry no state record.

labelsstring[]
reliabilitynumber nullable

Ratio of passed executions to passed and failed executions. Null when there were no executions in the aggregation window.

duration_avgnumber nullable

Average execution duration in seconds. Null when there were no executions in the aggregation window.

duration_sumnumber nullable

Total execution duration in seconds. Null when there were no executions in the aggregation window.

duration_minnumber nullable

Shortest execution duration in seconds. Null when there were no executions in the aggregation window.

duration_maxnumber nullable

Longest execution duration in seconds. Null when there were no executions in the aggregation window.

executions_countinteger

Number of executions in the aggregation window.

Changes

No recorded changes to this operation across all 1 revision of this API.