Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to kick off all tests?

Tags:

bazel

I'm not very familiar with Bazel, other than having to add or remove a few things from BUILD here and there and knowing how to execute the tests in a certain directory.

I'm currently working in a code base that has unit tests scattered throughout subdirectories, but they're all within that subdirectory's BUILD. Is there a way to kick off all the tests?

like image 772
roulette01 Avatar asked Dec 12 '25 11:12

roulette01


2 Answers

You can run all tests via:

bazel test //...

Maybe you need some config to run your test (see .bazelrc)

bazel --config=my_config //...

Similar you can build your complete workspace via:

bazel build //...
like image 122
Vertexwahn Avatar answered Dec 15 '25 00:12

Vertexwahn


Having a look at the "Building multiple targets" section in the Bazel target reference. In particular, you are likely looking for invocations like bazel test //subdir:all or bazel test //subdir/....

like image 35
Benjamin Peterson Avatar answered Dec 15 '25 00:12

Benjamin Peterson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!