Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/test_framework.py
Show First 20 Lines • Show All 296 Lines • ▼ Show 20 Lines | def shutdown(self): | ||||
self.log.info("Tests successful") | self.log.info("Tests successful") | ||||
exit_code = TEST_EXIT_PASSED | exit_code = TEST_EXIT_PASSED | ||||
elif self.success == TestStatus.SKIPPED: | elif self.success == TestStatus.SKIPPED: | ||||
self.log.info("Test skipped") | self.log.info("Test skipped") | ||||
exit_code = TEST_EXIT_SKIPPED | exit_code = TEST_EXIT_SKIPPED | ||||
else: | else: | ||||
self.log.error( | self.log.error( | ||||
"Test failed. Test logging available at {}/test_framework.log".format(self.options.tmpdir)) | "Test failed. Test logging available at {}/test_framework.log".format(self.options.tmpdir)) | ||||
self.log.error("") | |||||
self.log.error("Hint: Call {} '{}' to consolidate all logs".format(os.path.normpath( | 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)) | os.path.dirname(os.path.realpath(__file__)) + "/../combine_logs.py"), self.options.tmpdir)) | ||||
self.log.error("") | |||||
self.log.error( | |||||
"If this failure happened unexpectedly or intermittently, please" | |||||
" file a bug and provide a link or upload of the combined log.") | |||||
self.log.error(self.config['environment']['PACKAGE_BUGREPORT']) | |||||
self.log.error("") | |||||
exit_code = TEST_EXIT_FAILED | exit_code = TEST_EXIT_FAILED | ||||
# Logging.shutdown will not remove stream- and filehandlers, so we must | # Logging.shutdown will not remove stream- and filehandlers, so we must | ||||
# do it explicitly. Handlers are removed so the next test run can apply | # do it explicitly. Handlers are removed so the next test run can apply | ||||
# different log handler settings. | # different log handler settings. | ||||
# See: https://docs.python.org/3/library/logging.html#logging.shutdown | # See: https://docs.python.org/3/library/logging.html#logging.shutdown | ||||
for h in list(self.log.handlers): | for h in list(self.log.handlers): | ||||
h.flush() | h.flush() | ||||
h.close() | h.close() | ||||
▲ Show 20 Lines • Show All 393 Lines • Show Last 20 Lines |