-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bazel test generate test.xml miss "classname" which cannot pass the junit schema check #16759
Comments
The Bazel docs say: "The XML schema is based on the JUnit test result schema." Interpreting this phrasing literally, this is not a bug. Tbh though I'm not sure if the phrasing perfectly matches the intent of the code. Would you like me to research if the code actually intends to use the JUnit schema, or is my point above sufficient to show this is not a bug and we can close this, or is this actually a FR for Bazel to use the JUnit schema (i.e. use a dummy |
I think the doc means bazel test generated XML format should be compatible with the JUnit schema, which require
Yes, please. |
Okay I've read through the codebase's history and current state. I have a few main observations to share with you:
So,
Footnotes
|
@haxorz I think this is a good option. If there are test runners overriding the default xml file I would think the onus would be on the test runner to produce a valid result. |
Just wanted to clarify:
Other way around. The test runner may produce a That's why in (a) I was saying you could look into making the test runner being used in #882 produce a
Well one of my points thus far has been that "valid" doesn't mean "valid per the junit spec". But yeah I agree that if you have an issue with a specific test runner you should talk to whoever owns it or fix the problem yourself. |
I think there are cases where we can't always override the xml from inside the test target, like if the test_timeout has been exceeded? As far as I can tell, Bazel will still output it's own xml which is missing classname. |
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale. |
@bazelbuild/triage not stale |
Description of the bug:
the
bazel test
output filetest.xml
failed to pass the junit validationWhat's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
bazel test //package:target
Check the XML reports are located in
bazel-testlogs/package/target/test.xml
🔥 Exception or Error
miss the
classname
attribute which is required in the junit schemaWhich operating system are you running Bazel on?
centos
What is the output of
bazel info release
?No response
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.Build label: 4.2.3
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Oct 19 08:27:37 2022 (1666168057)
Build timestamp: 1666168057
Build timestamp as int: 1666168057
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
https://cs.opensource.google/bazel/bazel/+/master:tools/test/generate-xml.sh;l=118
Any other information, logs, or outputs that you want to share?
bazelbuild/rules_python#882
The text was updated successfully, but these errors were encountered: