Handle tests that omit JUnit XML output - #21
Merged
Conversation
alexeagle
requested review from
bllanesfigma,
dmiller-figma and
tbarrella-figma
August 19, 2026 22:17
alexeagle
marked this pull request as ready for review
August 19, 2026 22:17
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 45e5720. Configure here.
dmiller-figma
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Bazel test actions declare
test.xmlas an output and now have an explicit policy for runners that exit without creating it.This change:
--experimental_test_xml_missing_behavior={legacy,fail,warn,workaround}legacy, preserving silent derived XML generationfailreject a successful test action that omittedtest.xmlwarnemit a warning and run the derived XML action under the distinctTestXmlGenerationFallbackmnemonicworkaroundsupervise the test, preserve its exit status, and atomically create minimal JUnit XML only when the runner did not--run_under, coverage, signal, and remote-execution command ordering intactWhy
Some test runners ignore Bazel's
XML_OUTPUT_FILEcontract. Bazel historically hides that by deriving XML fromtest.log. That makes missing runner output hard to detect and prevents controlled migration to stricter behavior.The new policy supports three migration steps:
warnworkaroundfailThe wrapper never replaces XML written by the test. If it cannot publish XML, workaround mode fails instead of hiding the problem behind the later derived-XML action.
Relationship to split XML generation
--experimental_split_xml_generationmoved fallback XML creation out oftest-setup.shinto a separate spawn, fixing subtle output and signal-handling races. It had been default-on since 2019 and was removed in Bazel 9 by #26049 because split generation was considered stable; Bazel 9 always uses that path.That fixed how Bazel creates fallback XML, but not the underlying contract violation. When a runner omits
test.xml, Bazel still silently synthesizes one fromtest.log, so CI receives XML while the missing runner report remains invisible. This PR adds policy at that decision point: observe it, wrap it for compatibility, or fail it.This PR targets
8.8.0-figma, where--experimental_split_xml_generationstill exists and defaults to true.Validation
bazel test //src/test/java/com/google/devtools/build/lib/analysis:AnalysisTests //src/test/java/com/google/devtools/build/lib/exec:ExecTestswith focused test filtersbazel test //tools/test/ensure_xml:ensure_xml_testbazel build //src:bazel//examples/shell:testinworkaroundmode on Darwin arm64ensure_xml_darwin_arm64supervised executionbash -n tools/test/test-setup.sh