-
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
Allow Skylark test rules to emit test/benchmark details for summary #250
Comments
Most of this already exists. Your test should emit a .xml file in a schema that understands. |
Neat. Is this documented/stable? How does a Skylark rule mark a file to be parsed by Bazel? |
AFAICR, the test framework should just emit the .XML file, and it should work automatically. The support has been there for years, so it shoul dbe pretty stable. |
Where should the file be emitted and what should it be named? Tests are run in their respective runfiles directory so I'm assuming the file should be relative to that. Can sh_tests do the same thing? |
it should have the same name as the test log file, but with xml as an extension. Come to think of it, the file name should probably be passed as an environment variable somewhere; I will have a look at the internal variant. |
in sh_test the good variable is XML_OUTPUT_FILE (see https://github.com/google/bazel/blob/master/src/test/shell/unittest.bash#L450) It should be the same for other test runner I believe. |
|
It'd be nice if Skylark test rules could emit details about the tests it ran and have them appear in Bazel's test summary.
For instance, a Skylark test rule for Go could parse the test binary's output for which exact tests passed/failed, how long each took, and any log output. It could then be relayed back to Bazel through a special file (possibly JSON) which can be used to populate each TestResultData proto and be displayed to the user.
Likewise, I think Bazel should support benchmarks in a similar way (perhaps through
bazel benchmark
instead ofbazel test
).The text was updated successfully, but these errors were encountered: