Speculative: emit test XML from diff/cmp validate for Bazel 9#47
Closed
alexeagle wants to merge 1 commit into
Closed
Speculative: emit test XML from diff/cmp validate for Bazel 9#47alexeagle wants to merge 1 commit into
alexeagle wants to merge 1 commit into
Conversation
Bazel 9 drops the flag that generates test XML in a follow-up spawn, so test runners must write $XML_OUTPUT_FILE themselves. Add a shared helper matching Bazel's generate-xml.sh and a build_test rule that emits XML.
Collaborator
Author
|
OH I am dumb, the whole point here is validation actions, not tests. no xml |
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
This is speculative. It explores what it would take for
diff.bzlto emit JUnit XML under Bazel 9 (bazelbuild/bazel#28111), where test runners must write$XML_OUTPUT_FILEthemselves.Scoped to the public API only (
diffandcmpwithvalidate=1), not internalbuild_testtargets:tools/test/emit-test-xml.sh— shared helper matching Bazel'sgenerate-xml.shcontracttools/test/run_with_xml.sh— generic wrapper for future test entrypointsdiff/private/validate.sh+validate.bzl— shared validation script used bydiffandcmpthat emits XML when$XML_OUTPUT_FILEis setbuild_testis left on@bazel_skylibunchanged.Caveat: If every test implementation across the ecosystem has to do this individually, that's an awful lot of work. This PR only covers the
validate=1path in the publicdiff/cmprules. Note that validation actions are build-time assertions (OutputGroupInfo(_validation=...)), notbazel testactions — so$XML_OUTPUT_FILEis only emitted when that env var is present (e.g. if validations are ever run as test actions). Internalbuild_testtargets will still fail to producetest.xmlunderfigma/8.7.0-figma2.Test plan
USE_BAZEL_VERSION=figma/8.7.0-figma2 bazel build //:validateine2e/smoke— passesbazel test //:smoke_testunder figma Bazel — expected to fail (build_test doesn't write XML; out of scope)//diff/tests:build_test— blocked on macOS by pre-existing GNU diff3 / BSDdifftoolchain issue