Buck: Stop spamming standard output on unit test failures
Since [1] Buck spam standard output with debug messages in test failure
case. Monkey patch the java_test() rule to avoid it. Also file the
upstream issue to change the default log level from debug to info: [2].
[1] cc05fdbedc
[2] https://github.com/facebook/buck/issues/505
Change-Id: I04c86a9bacdd188724a79268ef879f676ec35217
This commit is contained in:
parent
87dd1d6ad2
commit
94e93aaad2
@ -27,6 +27,7 @@ from multiprocessing import cpu_count
|
||||
# Set defaults on java rules:
|
||||
# - Add AutoValue annotation processing support.
|
||||
# - Treat source files as UTF-8.
|
||||
# - std_out_log_level = info (the default is too spammy)
|
||||
|
||||
_buck_java_library = java_library
|
||||
def java_library(*args, **kwargs):
|
||||
@ -36,9 +37,9 @@ def java_library(*args, **kwargs):
|
||||
_buck_java_test = java_test
|
||||
def java_test(*args, **kwargs):
|
||||
_munge_args(kwargs)
|
||||
_do_not_spam_std_out(kwargs)
|
||||
_buck_java_test(*args, **kwargs)
|
||||
|
||||
|
||||
# Munge kwargs to set Gerrit-specific defaults.
|
||||
def _munge_args(kwargs):
|
||||
_set_auto_value(kwargs)
|
||||
@ -56,6 +57,11 @@ def _set_extra_arguments(kwargs):
|
||||
|
||||
extra_args.extend(['-encoding', 'UTF-8'])
|
||||
|
||||
def _do_not_spam_std_out(kwargs):
|
||||
level = 'std_out_log_level'
|
||||
if level not in kwargs:
|
||||
kwargs[level] = 'INFO'
|
||||
|
||||
def _set_auto_value(kwargs):
|
||||
apk = 'annotation_processors'
|
||||
if apk not in kwargs:
|
||||
|
Loading…
Reference in New Issue
Block a user