Dylan Powers
Dylan Powers

Reputation: 249

Can I make Bazel always output errors on tests from a rule?

I want to make it so that every time I run bazel test in my project, I can see errors in the console. This is the equivalent of passing --test_output=errors as a flag every time, but I was wondering if there is a way I can do it from within my java_test rule so that I don't have to pass that flag every time?

Upvotes: 2

Views: 1268

Answers (1)

Matt Mackay
Matt Mackay

Reputation: 1329

I don't think this can be set on a per target basis, however Bazel can take options from a .bazelrc file which can be added to the project.

A .bazelrc file could be added with the following contents:

test --test_output=errors

Which would set the --test_output flag for the test command.

Upvotes: 2

Related Questions