Hive Hive
Sign in

Bazel docs disagree on whether plain bazel test reports individual test cases

GitHub issue · Open

Metadata
Source
tuist/tuist #13132
Updated
Sep 10, 2026
Details

Two Bazel docs pages state opposite things about what a plain bazel test reports, and the code doesn’t settle it.

  • server/priv/docs/en/guides/features/test-insights/bazel.md:22 — “Ordinary bazel test still runs your tests, but does not report individual cases to Tuist and does not enforce quarantine policies.”
  • server/priv/docs/en/guides/features/test-insights/flaky-tests/bazel.md:28 — “Ordinary bazel test still reports test results, but does not fetch or enforce Tuist quarantine policies.”

One of them is wrong. #13130 deliberately left both alone rather than pick by guesswork.

What the code establishes

Reporting is not gated on the CLI wrapper:

  • Kura handles BEP TestResult events straight off the Build Event Service stream (kura/src/reapi/bep.rs:803-836).
  • .bazelrc.tuist emits --bes_backend under the build command (BazelrcFile.swift:40-48), which Bazel applies to test too.
  • BazelTestCommandService has no upload path — its collaborators are a config loader, a server-environment service, ListTestCasesService (a read), and a command runner. It fetches the quarantine policy and shells out.
  • The server parses the JUnit report into individual cases via JunitReport.parseTests.create_test (test_report_ingestor.ex:29-49).

So tuist bazel test adds quarantine, not reporting.

What it doesn’t establish

Kura never receives the test.xml bytes. It resolves them by digest from its own REAPI store:

// kura/src/bazel_test_artifacts.rs:478-486
let key = blob_key(&format!("{}/{}", artifact.digest, artifact.size));
let manifest = self.store.manifest_for_key(ArtifactProducer::Reapi, project_handle, &key)

If the blob isn’t in Tuist’s cache it records bazel_test_artifact/missing, and the ingestor’s parse_report/1 falls through to %{test_suites: [], test_cases: []} — you get the invocation and the per-target summary, but nothing case-level.

That makes case-level reporting conditional on Bazel having uploaded the test outputs to Tuist’s CAS. The load-bearing question is whether a failing test’s outputs get there. Bazel doesn’t cache failed test results; if it also doesn’t upload their outputs, a plain bazel test would surface passing cases and silently drop failures — exactly the case test insights exist for.

Nothing in the repo answers it:

  • kura/spec/e2e/ has no BES or test-result spec.
  • server/test/tuist/bazel/test_report_ingestor_test.exs has no missing-artifact case.
  • .bazelrc.tuist sets no upload flags; Kura’s own e2e harness passes --remote_upload_local_results=true explicitly (kura/spec/e2e/support.sh:445) rather than relying on the default.

How to settle it

Run a Bazel target with one passing and one deliberately failing case against a project with .bazelrc.tuist, using plain bazel test, then check whether each case appears in the dashboard. Worth covering both a cold run and a re-run, since a cached result behaves differently from a locally executed one.

Then:

  1. Correct whichever sentence is wrong, and state the condition if reporting turns out to depend on outputs reaching the cache.
  2. If failures genuinely don’t reach the CAS, that’s a product gap rather than a docs bug, and this issue should be re-scoped.
  3. Consider an ingestor test for the missing-artifact path — today it silently produces zero cases.

🤖 Generated with Claude Code

Flights

Investigate, reproduce, or fix this item in an isolated repository. Each Flight preserves its outcome and agent session.

New Flights are paused Configure model inference, GitHub, and a sandbox provider to start another Flight. Existing results remain available below.
No Flights yet

Start a Flight and preserve its objective, outcome, and session here.

Comments

No GitHub comments yet.