Browse Source

[tests] Improve logging shutdown and add hint for combine_logs

0.16
John Newbery 7 years ago
parent
commit
bba1c54edd
  1. 8
      test/functional/test_framework/test_framework.py

8
test/functional/test_framework/test_framework.py

@ -167,14 +167,16 @@ class BitcoinTestFramework():
if success == TestStatus.PASSED: if success == TestStatus.PASSED:
self.log.info("Tests successful") self.log.info("Tests successful")
sys.exit(TEST_EXIT_PASSED) exit_code = TEST_EXIT_PASSED
elif success == TestStatus.SKIPPED: elif success == TestStatus.SKIPPED:
self.log.info("Test skipped") self.log.info("Test skipped")
sys.exit(TEST_EXIT_SKIPPED) exit_code = TEST_EXIT_SKIPPED
else: else:
self.log.error("Test failed. Test logging available at %s/test_framework.log", self.options.tmpdir) self.log.error("Test failed. Test logging available at %s/test_framework.log", self.options.tmpdir)
self.log.error("Hint: Call {} '{}' to consolidate all logs".format(os.path.normpath(os.path.dirname(os.path.realpath(__file__)) + "/../combine_logs.py"), self.options.tmpdir))
exit_code = TEST_EXIT_FAILED
logging.shutdown() logging.shutdown()
sys.exit(TEST_EXIT_FAILED) sys.exit(exit_code)
# Methods to override in subclass test scripts. # Methods to override in subclass test scripts.
def set_test_params(self): def set_test_params(self):

Loading…
Cancel
Save