[英]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.我想让它每次在我的项目中运行
bazel test
时,我都可以在控制台中看到错误。 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?这相当于每次都将
--test_output=errors
作为标志传递,但我想知道是否有一种方法可以从我的java_test
规则中做到这一点,这样我就不必每次都传递那个标志?
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.我认为这不能针对每个目标进行设置,但是 Bazel 可以从可以添加到项目中的
.bazelrc
文件中获取选项。
A .bazelrc
file could be added with the following contents:可以添加具有以下内容的
.bazelrc
文件:
test --test_output=errors
Which would set the --test_output
flag for the test
command.这将为
test
命令设置--test_output
标志。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.