Use test
to run all “testable” targets and report Pass or Fail. For example, to run all tests in the repository using a Target Pattern:
bazel test //...
Control over the test process is largely left to the user's Bazel command-line flags. This includes things like:
--test_args
- arguments to forward to the test runner's CLI--test_env
- which environment variables should be included in the test's inputs (and cache key)--test_output
--test_output=streamed
- useful to say, "stream the log", so it's similar to watching the test runner CLI run--test_output=errors
- typical to get Bazel to print the test failures tostdout
, otherwise you can only get them from the log inbazel-testlogs