If the test crashes, provide the full traceback at the end of the self.outputs. This way we can quickly examine the cause from the body of the email and don't have to search for full autoqa logs on the server. --- lib/python/decorators.py | 6 +++--- lib/python/test.py | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/lib/python/decorators.py b/lib/python/decorators.py index 7db78ad..0e504fc 100644 --- a/lib/python/decorators.py +++ b/lib/python/decorators.py @@ -76,12 +76,12 @@ class ExceptionCatcher(object): #if the 'on_exception' is a name of 'class member function' #then call the f_self.on_exception(oe_args, oe_kwargs) if self.oe_is_self_method: - f_self.__getattribute__(self.oe)(exc = exc_info[1], *self.oe_a, **self.oe_k) + f_self.__getattribute__(self.oe)(exc = exc_info, *self.oe_a, **self.oe_k) #'on_exception' is pointer to function else: - self.oe(exc = exc_info[1], *self.oe_a, **self.oe_k) + self.oe(exc = exc_info, *self.oe_a, **self.oe_k) #re-raise the stored exception - raise exc_info[1], None, exc_info[2] + raise exc_info[0], exc_info[1], exc_info[2] return f_result return newf
diff --git a/lib/python/test.py b/lib/python/test.py index f04ad10..eccbb09 100644 --- a/lib/python/test.py +++ b/lib/python/test.py @@ -49,14 +49,18 @@ class AutoQATest(test.test, object): pass
def process_exception(self, exc = None): + self._convert_list_variables() + self.result = "CRASHED" if exc is not None: - self.summary = "%s: %s" % (exc.__class__.__name__, exc) + self.summary = "%s: %s" % (exc[1].__class__.__name__, exc[1]) + self.outputs += '\n%s\n%s' % ('-'*70, + ''.join(traceback.format_exception(exc[0], exc[1], exc[2]))) else: self.summary = "Exception: Unknown exception" try: self.postprocess_iteration() - except Exception, e: + except Exception: traceback.print_exc(file=sys.stderr)
def postprocess_iteration(self):
----- "Kamil Páral" kparal@redhat.com wrote:
If the test crashes, provide the full traceback at the end of the self.outputs. This way we can quickly examine the cause from the body of the email and don't have to search for full autoqa logs on the server.
lib/python/decorators.py | 6 +++--- lib/python/test.py | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-)
Note, this is based on Josef's "[PATCH] Removed individual XYZ_failed methods in test.py". James, it should address your concern of now knowing in which method the exception occurred. We won't have it in the mail subject, but it will be included in the traceback in the mail body.
On Wed, 2010-10-06 at 09:08 -0400, Kamil Paral wrote:
----- "Kamil Páral" kparal@redhat.com wrote:
If the test crashes, provide the full traceback at the end of the self.outputs. This way we can quickly examine the cause from the body of the email and don't have to search for full autoqa logs on the server.
lib/python/decorators.py | 6 +++--- lib/python/test.py | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-)
Note, this is based on Josef's "[PATCH] Removed individual XYZ_failed methods in test.py". James, it should address your concern of now knowing in which method the exception occurred. We won't have it in the mail subject, but it will be included in the traceback in the mail body.
Thanks Kamil, this seems like a nice improvement.
With regards to the patch itself, I can't find anything wrong with either this patchset, or the XYZ_failed set. I have mixed feelings though, this is the patch you don't want to see in action, that means tests are 'sploding :)
Thanks, James
----- "James Laska" jlaska@redhat.com wrote:
On Wed, 2010-10-06 at 09:08 -0400, Kamil Paral wrote:
----- "Kamil Páral" kparal@redhat.com wrote:
If the test crashes, provide the full traceback at the end of the self.outputs. This way we can quickly examine the cause from the
body
of the email and don't have to search for full autoqa logs on the server.
lib/python/decorators.py | 6 +++--- lib/python/test.py | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-)
Note, this is based on Josef's "[PATCH] Removed individual
XYZ_failed
methods in test.py". James, it should address your concern of now
knowing
in which method the exception occurred. We won't have it in the
subject, but it will be included in the traceback in the mail body.
Thanks Kamil, this seems like a nice improvement.
With regards to the patch itself, I can't find anything wrong with either this patchset, or the XYZ_failed set. I have mixed feelings though, this is the patch you don't want to see in action, that means tests are 'sploding :)
Ok, both patches pushed.
autoqa-devel@lists.fedorahosted.org