What's the difference between bazel test
vs bazel run
on the the java test rule? When I run the bazel run
command, my test passes just fine, while with bazel test
I get an error. If needed, I can provide more details, but I was interested in general differences between those two commands.
Asked
Active
Viewed 7,531 times
11

nme
- 647
- 1
- 7
- 22
2 Answers
4
Bazel test launches the test in an isolated container. Due to this any default environment variable that were not explicitly set would not be available for test system. A typical example would be HELM_HOME being blank in bazel test.

rbrb
- 56
- 2
0
You can run a single test target with bazel run
. bazel test
is highly parallel, has more options regarding tests and better reporting.

eik
- 2,104
- 12
- 15