Bazel test report for python unittest has no test case break down

459 views
Skip to first unread message

Kamesh Raj Velu

unread,
Jan 31, 2018, 6:23:44 PM1/31/18
to bazel-...@googlegroups.com
New to Bazel please pardon my ignorance. 

Hi
When I run bazel test for my python unittest, the XML report under bazel-testlogs doesn't have individual test case breakdown. It is considering the test target (file name) as one suite and it has one test case which is again the target name. 

Is it possible to expose the individual test cases from my target to bazel?

Thanks
Kamesh


Evan Jones

unread,
Feb 1, 2018, 10:20:39 AM2/1/18
to bazel-discuss
This is not the answer you want to hear: but rules_pyz's pyz_test target [1] or the bazel_rules_pex's pex_pytest target [2] do this. They use pytest to run the tests, and pytest outputs the XML with individual cases. You could also probably use those macros / rules as an example for how to write a Pytest rule that uses the native Python rules, but that will take a bit of work.

I'd recommend filing an issue in https://github.com/bazelbuild/rules_python so this issue is visible, since there is active discussion occurring about how to make Python support in Bazel work better: https://groups.google.com/forum/#!topic/bazel-discuss/k8MN4BmyjTY

kv...@google.com

unread,
Feb 5, 2018, 3:29:56 PM2/5/18
to bazel-discuss
Thank you I will check this out.
Reply all
Reply to author
Forward
0 new messages