mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-10 22:46:58 +02:00
Only print out ERROR log rather than DEBUG log as DEBUG is overly verbose.
Change-Id: If9603879ed4778a2c6bb037ec9ced0eb86482444 BUG=chromium-os:11682 TEST=Ran on tmp dir with failed test. Saw error log get printed out rather than debug Review URL: http://codereview.chromium.org/6639001
This commit is contained in:
parent
c750ac2c4d
commit
a2fcb05593
@ -252,23 +252,23 @@ class ReportGenerator(object):
|
|||||||
print self._color.Color(Color.GREEN,
|
print self._color.Color(Color.GREEN,
|
||||||
'No crashes detected during testing.')
|
'No crashes detected during testing.')
|
||||||
|
|
||||||
# Print out the client debug information for failed tests.
|
# Print out error log for failed tests.
|
||||||
if self._options.print_debug:
|
if self._options.print_debug:
|
||||||
for test in tests_with_errors:
|
for test in tests_with_errors:
|
||||||
debug_file_regex = os.path.join(self._options.strip, test, 'debug',
|
debug_file_regex = os.path.join(self._options.strip, test, 'debug',
|
||||||
'%s*.DEBUG' % os.path.basename(test))
|
'%s*.ERROR' % os.path.basename(test))
|
||||||
for path in glob.glob(debug_file_regex):
|
for path in glob.glob(debug_file_regex):
|
||||||
try:
|
try:
|
||||||
fh = open(path)
|
fh = open(path)
|
||||||
print >> sys.stderr, (
|
print >> sys.stderr, (
|
||||||
'\n========== DEBUG FILE %s FOR TEST %s ==============\n' % (
|
'\n========== ERROR FILE %s FOR TEST %s ==============\n' % (
|
||||||
path, test))
|
path, test))
|
||||||
out = fh.read()
|
out = fh.read()
|
||||||
while out:
|
while out:
|
||||||
print >> sys.stderr, out
|
print >> sys.stderr, out
|
||||||
out = fh.read()
|
out = fh.read()
|
||||||
print >> sys.stderr, (
|
print >> sys.stderr, (
|
||||||
'\n=========== END DEBUG %s FOR TEST %s ===============\n' % (
|
'\n=========== END ERROR FILE %s FOR TEST %s ===========\n' % (
|
||||||
path, test))
|
path, test))
|
||||||
fh.close()
|
fh.close()
|
||||||
except:
|
except:
|
||||||
@ -312,7 +312,7 @@ def main():
|
|||||||
help='Don\'t strip a prefix from test directory names')
|
help='Don\'t strip a prefix from test directory names')
|
||||||
parser.add_option('--no-debug', dest='print_debug', action='store_false',
|
parser.add_option('--no-debug', dest='print_debug', action='store_false',
|
||||||
default=True,
|
default=True,
|
||||||
help='Don\'t print out the debug log when a test fails.')
|
help='Don\'t print out logs when tests fail.')
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
if not args:
|
if not args:
|
||||||
|
Loading…
Reference in New Issue
Block a user