From: Andrew Schoen Date: Fri, 13 Feb 2015 17:32:59 +0000 (-0600) Subject: Include test failures in ctx.summary['failure_reason'] X-Git-Tag: 1.1.0~1004^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=4a233609921f338310be84f1a2bf5ba403bea745;p=teuthology.git Include test failures in ctx.summary['failure_reason'] I also added a new line to make reading the log nicer Signed-off-by: Andrew Schoen --- diff --git a/teuthology/task/tests/__init__.py b/teuthology/task/tests/__init__.py index 7b879aabcf..8769710b10 100644 --- a/teuthology/task/tests/__init__.py +++ b/teuthology/task/tests/__init__.py @@ -32,6 +32,7 @@ class TeuthologyContextPlugin(object): def __init__(self, ctx, config): self.ctx = ctx self.config = config + self.failures = list() # this is pytest hook for generating tests with custom parameters def pytest_generate_tests(self, metafunc): @@ -69,10 +70,16 @@ class TeuthologyContextPlugin(object): )) else: # TODO: figure out a way to log the traceback - log.error("{name} Failed: {info}".format( + log.error("{name} Failed:\n {info}".format( name=name, info=call.excinfo.exconly() )) + failure = "{name}: {err}".format( + name=name, + err=call.excinfo.exconly().replace("\n", "") + ) + self.failures.append(failure) + self.ctx.summary['failure_reason'] = self.failures return report