如何减少bazel打印?

时间:2018-04-28 15:07:04

标签: bazel

当我使用bazel运行测试时,它输出如下内容:

endobson@yggdrasil () ~/proj/racket/yaspl2 % ibazel test //libraries/... //tools/...                                                                                                                                                      (3)
Testing //libraries/... //tools/...
INFO: Analysed 466 targets (0 packages loaded).
INFO: Found 431 targets and 35 test targets...
INFO: Elapsed time: 0.296s, Critical Path: 0.00s
INFO: Build completed successfully, 1 total action
//libraries:byte-escapes-test                                   (cached) PASSED in 0.1s
//libraries:fill-stack-test                                     (cached) PASSED in 0.1s
//libraries:large-function-test                                 (cached) PASSED in 0.2s
//libraries:lexer-test                                          (cached) PASSED in 0.2s
//libraries:module-signature-serialization-test                 (cached) PASSED in 0.2s
//libraries:pretty-print-test                                   (cached) PASSED in 0.2s
//libraries:resolved-imports-language-test                      (cached) PASSED in 0.2s
//libraries:sexp-parser-test                                    (cached) PASSED in 0.2s
//libraries:sexp-printer-test                                   (cached) PASSED in 0.2s
//libraries:tail-call-test                                      (cached) PASSED in 0.1s
//libraries:type-checker-test                                   (cached) PASSED in 0.2s
//libraries:type-unification-test                               (cached) PASSED in 0.2s
//libraries:types-test                                          (cached) PASSED in 0.2s
//libraries/algorithms:depth-first-search-test                  (cached) PASSED in 0.2s
//libraries/data:bytes-test                                     (cached) PASSED in 0.1s
//libraries/data:dict-test                                      (cached) PASSED in 0.2s
//libraries/data:list-test                                      (cached) PASSED in 0.1s
//libraries/data:maybe-test                                     (cached) PASSED in 0.2s
//libraries/data:red-black-tree-test                            (cached) PASSED in 0.2s
//libraries/data:regexp-test                                    (cached) PASSED in 0.2s
//libraries/data:set-test                                       (cached) PASSED in 0.1s
//libraries/data:tuples-test                                    (cached) PASSED in 0.2s
//libraries/prim-language:color-graph-test                      (cached) PASSED in 0.2s
//libraries/prim-language:lower-x86-64-test                     (cached) PASSED in 0.2s
//libraries/prim-language/examples:call1_test                   (cached) PASSED in 0.2s
//libraries/prim-language/examples:call2_test                   (cached) PASSED in 0.2s
//libraries/prim-language/examples:call3_test                   (cached) PASSED in 0.2s
//libraries/prim-language/examples:cast1_test                   (cached) PASSED in 0.2s
//libraries/prim-language/examples:exit_test                    (cached) PASSED in 0.2s
//libraries/prim-language/examples:factorial_test               (cached) PASSED in 0.2s
//libraries/prim-language/examples:hello-world_test             (cached) PASSED in 0.2s
//libraries/prim-language/examples:pointers1_test               (cached) PASSED in 0.2s
//libraries/prim-language/examples:pointers2_test               (cached) PASSED in 0.1s
//libraries/prim-language/examples:pointers3_test               (cached) PASSED in 0.2s
//libraries/prim-language/examples:spill_test                   (cached) PASSED in 0.2s

这是一个大量的文字,占据了我的大部分笔记本电脑屏幕。当存在构建错误时,它们最终会超过所有失败的测试。 E.g。

Testing //libraries/... //tools/...
INFO: Analysed 466 targets (0 packages loaded).
INFO: Found 431 targets and 35 test targets...
ERROR: /Users/endobson/proj/racket/yaspl2/libraries/BUILD:441:1: Couldn't build file libraries/mach-o-writer_lib.o: YasplCompile libraries/mach-o-writer_lib.o failed (Exit 1)
Not a valid argument
ERROR: /Users/endobson/proj/racket/yaspl2/libraries/BUILD:441:1: Couldn't build file libraries/mach-o-writer_lib.o: YasplCompile libraries/mach-o-writer_lib.o failed (Exit 1)
Not a valid argument
INFO: Elapsed time: 0.356s, Critical Path: 0.04s
FAILED: Build did NOT complete successfully
//libraries:byte-escapes-test                                   (cached) PASSED in 0.1s
//libraries:fill-stack-test                                     (cached) PASSED in 0.1s
//libraries:large-function-test                                 (cached) PASSED in 0.2s
//libraries:lexer-test                                          (cached) PASSED in 0.2s
//libraries:module-signature-serialization-test                 (cached) PASSED in 0.2s
//libraries:pretty-print-test                                   (cached) PASSED in 0.2s
//libraries:resolved-imports-language-test                      (cached) PASSED in 0.2s
//libraries:sexp-parser-test                                    (cached) PASSED in 0.2s
//libraries:sexp-printer-test                                   (cached) PASSED in 0.2s
//libraries:tail-call-test                                      (cached) PASSED in 0.1s
//libraries:type-checker-test                                   (cached) PASSED in 0.2s
//libraries:type-unification-test                               (cached) PASSED in 0.2s
//libraries:types-test                                          (cached) PASSED in 0.2s
//libraries/algorithms:depth-first-search-test                  (cached) PASSED in 0.2s
//libraries/data:bytes-test                                     (cached) PASSED in 0.1s
//libraries/data:dict-test                                      (cached) PASSED in 0.2s
//libraries/data:list-test                                      (cached) PASSED in 0.1s
//libraries/data:maybe-test                                     (cached) PASSED in 0.2s
//libraries/data:red-black-tree-test                            (cached) PASSED in 0.2s
//libraries/data:regexp-test                                    (cached) PASSED in 0.2s
//libraries/data:set-test                                       (cached) PASSED in 0.1s
//libraries/data:tuples-test                                    (cached) PASSED in 0.2s
//libraries/prim-language:color-graph-test                      (cached) PASSED in 0.2s
//libraries/prim-language:lower-x86-64-test                     (cached) PASSED in 0.2s

Executed 0 out of 35 tests: 24 tests pass and 11 fail to build.
There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are.

有没有办法隐藏所有“PASSED”测试目标,只输出构建和测试失败,可能还有底部的摘要行?我试过的所有记录的详细选项似乎都没有改变这一点。

1 个答案:

答案 0 :(得分:0)

不确定您尝试了什么。 --test_output=errors --noshow_progress对我来说效果不错,至少0.12.0。

bazel --batch test --jobs 2 --test_output=errors --noshow_progress --test_timeout=300,300,900,3600 //...