diff options
author | MarcoFalke <falke.marco@gmail.com> | 2017-03-28 11:24:14 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2017-03-28 11:24:50 +0200 |
commit | c412fd805ddf3282dc2e1f28e30f51ffcb1f1da2 (patch) | |
tree | 88f2cef141d78b7c3c14bad937d14acfb4b7ae8e /test/functional/test_framework | |
parent | 5114f8113627791b871c88998bd5a3d36961c241 (diff) | |
parent | 8c7288c06b3cb2ec6353b006ae9b2a75da6b7635 (diff) |
Merge #9780: Suppress noisy output from qa tests in Travis
8c7288c Print out the final 1000 lines of test_framework.log if test fails (John Newbery)
6d780b1 Update travis config to run rpc-tests.py in quiet mode (John Newbery)
55992f1 Add --quiet option to suppress rpc-tests.py output (John Newbery)
Tree-SHA512: ab080458a07a9346d3b3cbc8ab59b73cea3d4010b1cb0206bb5fade0aaac7562c623475d0a02993f001b22ae9d1ba68e2d0d1a3645cea7e79cc1045b42e2ce3a
Diffstat (limited to 'test/functional/test_framework')
-rwxr-xr-x | test/functional/test_framework/test_framework.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index 26a8aacb41..473b7c14a9 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -4,6 +4,7 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Base class for RPC testing.""" +from collections import deque import logging import optparse import os @@ -177,12 +178,17 @@ class BitcoinTestFramework(object): # Dump the end of the debug logs, to aid in debugging rare # travis failures. import glob - filenames = glob.glob(self.options.tmpdir + "/node*/regtest/debug.log") + filenames = [self.options.tmpdir + "/test_framework.log"] + filenames += glob.glob(self.options.tmpdir + "/node*/regtest/debug.log") MAX_LINES_TO_PRINT = 1000 - for f in filenames: - print("From" , f, ":") - from collections import deque - print("".join(deque(open(f), MAX_LINES_TO_PRINT))) + for fn in filenames: + try: + with open(fn, 'r') as f: + print("From" , fn, ":") + print("".join(deque(f, MAX_LINES_TO_PRINT))) + except OSError: + print("Opening file %s failed." % fn) + traceback.print_exc() if success: self.log.info("Tests successful") sys.exit(self.TEST_EXIT_PASSED) |