{
  "slug": "bk-build-failed-tests-lists-tests-with-failed-executions-7b58255eed6a",
  "title": "bk build failed-tests lists tests with failed executions",
  "tools": [
    "bk"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-10-20T22:17:17.000Z",
  "announced_at": "2026-10-20T22:17:17.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When debugging tests for a Buildkite build, run `bk build failed-tests` with a build number, qualified selector, or build URL; add `--pipeline` if a plain number cannot be inferred unambiguously. The command lists tests with at least one failed execution, including tests that passed on retry.",
    "examples": [
      "bk build failed-tests <build-number> --pipeline <pipeline> --json",
      "bk build failed-tests <org>/<pipeline>/<build-number> --text",
      "bk build failed-tests https://buildkite.com/<org>/<pipeline>/builds/<build-number> --yaml"
    ],
    "gotchas": [
      "Version: v3.64.2",
      "build argument (required): Build number, `org/pipeline/number`, or Buildkite build URL.",
      "--pipeline: Pipeline slug or `org/pipeline`; inferred from configuration or repository if omitted. Specify it when inference is ambiguous, especially for JSON/YAML output.",
      "--json: Output as JSON; mutually exclusive with `--yaml` and `--text`.",
      "--yaml: Output as YAML; mutually exclusive with `--json` and `--text`.",
      "--text: Output as text; mutually exclusive with `--json` and `--yaml`.",
      "--output / -o: Select `json`, `yaml`, or `text` output format.",
      "Prerequisite: Token requires `read_builds` and `read_suites` scopes.",
      "Prerequisite: Uploaded Test Engine data associated with the build must be available from suites accessible to the token.",
      "Prerequisite: Authenticate/configure the CLI for the target organization; the README documents `bk auth login`.",
      "Requires `read_builds` and `read_suites` token scopes and uploaded Test Engine data associated with the build.",
      "The API aggregation window is bounded by retention and ends at most 24 hours after build creation.",
      "JSON/YAML never prompts for pipeline selection; specify `--pipeline` when inference is ambiguous.",
      "Fetches tests with at least one failed execution, including tests that passed on retry; it does not restrict results to flaky labels or require the build to be failed.",
      "Individual execution failure messages and backtraces are not included.",
      "An empty result does not prove that no tests failed, particularly when data is missing or inaccessible.",
      "Current test labels do not establish that flakiness caused a failure."
    ]
  },
  "why_it_matters": "Inspect failed test executions for a Buildkite build during test debugging.",
  "before": "The release note states that listing all failed tests for a build previously required calling the API directly; `bk job flaky-tests` only listed tests currently labelled flaky for one failed job.",
  "sources": [
    "https://github.com/buildkite/cli/releases/tag/v3.64.2",
    "https://github.com/buildkite/cli/pull/1048",
    "https://github.com/buildkite/cli/blob/v3.64.2/README.md",
    "https://github.com/buildkite/cli/blob/v3.64.2/cmd/build/failed_tests.go",
    "https://github.com/buildkite/cli/blob/v3.64.2/pkg/output/flags.go"
  ],
  "rank": 0.98059,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "daily-20261026-04",
    "verdict_id": "daily-20261026-04:daily-20261026-04-c6a48706f49c7374-0:gate",
    "evidence_hash": "9514c8805d925d463a66cf298230f5dfd0eaa11dd8da5d6a620f1a3220b0782b"
  },
  "review": {
    "draft_hash": "b84226280872823a7c6ea17a6cc2e3cb98359f87f94f84f765efc84f25321138",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-20T22:17:17.000Z",
    "decision": "daily-20261026-04:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.98 >= 0.9; 2 needed) and Jev gave 0.80 (>= 0.6 needed)."
  }
}
