Hive
Bazel docs disagree on whether plain bazel test reports individual test cases
GitHub issue · Open
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— “Ordinarybazel teststill 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— “Ordinarybazel teststill 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
TestResultevents straight off the Build Event Service stream (kura/src/reapi/bep.rs:803-836). .bazelrc.tuistemits--bes_backendunder thebuildcommand (BazelrcFile.swift:40-48), which Bazel applies totesttoo.BazelTestCommandServicehas 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.parse→Tests.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.exshas no missing-artifact case..bazelrc.tuistsets no upload flags; Kura’s own e2e harness passes--remote_upload_local_results=trueexplicitly (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:
- Correct whichever sentence is wrong, and state the condition if reporting turns out to depend on outputs reaching the cache.
- 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.
- Consider an ingestor test for the missing-artifact path — today it silently produces zero cases.
🤖 Generated with Claude Code
Investigate, reproduce, or fix this item in an isolated repository. Each Flight preserves its outcome and agent session.
Start a Flight and preserve its objective, outcome, and session here.
No GitHub comments yet.