Best way to run selected tests in Java

1,074 views
Skip to first unread message

Aman Singh

unread,
Mar 1, 2021, 2:41:43 AM3/1/21
to bazel-discuss
Hey Everyone.

We have a use-case where we want to apply a filter on the tests getting execute in Java. For eg: I want to execute only tests which match with a specific regex without reducing the scope of target in bazel test <target>. Is there any way to achieve this?
One way I can think of is running a bazel query first and then executing that test target. But for multiple tests, that will not scale well.

TIA!!

Lars Clausen

unread,
Mar 1, 2021, 8:33:13 AM3/1/21
to Aman Singh, bazel-discuss
Normally, I would use the --test_filter option (https://docs.bazel.build/versions/master/command-line-reference.html#flag--test_filter), does that not do what you need? You may also be able to use several --test_arg options.

-Lars

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/962699d9-1225-4620-8bc0-4e5648e1e67en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages