Skip to content

Expose flaky test failures for jobs - #1021

Merged
mcncl merged 1 commit into
mainfrom
feat/job_flaky_tests
Oct 8, 2026
Merged

mcncl merged 1 commit into
mainfrom
feat/job_flaky_tests

Conversation

@mcncl

@mcncl mcncl commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Description

The CLI does not expose Test Engine's flaky labels against a failed job, so agents cannot use that evidence when deciding whether to retry a failure.

Add bk job flaky-tests <job-uuid> to list tests with failed executions for that job that Test Engine currently labels flaky. This is not a verdict that flakiness caused the job failure; empty results remain inconclusive when data is missing or incomplete.

Related: PB-2564.

Changes

  • Support text, JSON, and YAML output, fetching all result pages with job/build IDs and test details in structured output.
  • Resolve the build UUID from the job and filter by job ID and failed executions. Leave normal job listing unchanged.
  • Document required token scopes and collector job metadata; return errors without partial output.
bk job flaky-tests <job-uuid> --text
bk job flaky-tests <job-uuid> --json

Testing

  • Tests have run locally (env -u BUILDKITE_API_TOKEN mise run test); the orb's token override otherwise interferes with existing credential tests.
  • Code is formatted (mise run format).

mise run lint reports 0 issues. Command tests cover pagination, JSON/YAML output, missing data, and API errors. Live Test Engine data was not exercised.

Disclosures / Credits

Amp implemented the command, tests, and documentation and prepared this description. Amp's Oracle reviewed the changes and reported no actionable correctness findings.

List failed tests currently labeled flaky by Test Engine for a job.
Keep empty results inconclusive rather than asserting a causal verdict.

Amp-Thread-ID: T-a1c01a67-e152-4121-8206-9bf76c88dbc4
@mcncl
mcncl requested review from a team as code owners October 8, 2026 06:53
@mcncl
mcncl merged commit 638db18 into main Oct 8, 2026
2 checks passed
@mcncl
mcncl deleted the feat/job_flaky_tests branch October 8, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant