[Piglit] [PATCH 2/2] framework: Get traceback into json results.

Jose Fonseca jfonseca at vmware.com
Tue Dec 8 08:14:22 PST 2015


Exceptions were not reaching it.
---
 framework/results.py       | 3 ++-
 templates/test_result.mako | 8 ++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/framework/results.py b/framework/results.py
index eeffcb7..ef19fd4 100644
--- a/framework/results.py
+++ b/framework/results.py
@@ -196,6 +196,7 @@ class TestResult(object):
             'subtests': self.subtests,
             'time': self.time,
             'exception': self.exception,
+            'traceback': self.traceback,
             'dmesg': self.dmesg,
         }
         return obj
@@ -215,7 +216,7 @@ class TestResult(object):
         # pylint: disable=assigning-non-slot
         inst = cls()
 
-        for each in ['returncode', 'command', 'exception', 'environment',
+        for each in ['returncode', 'command', 'exception', 'traceback', 'environment',
                      'time', 'result', 'dmesg']:
             if each in dict_:
                 setattr(inst, each, dict_[each])
diff --git a/templates/test_result.mako b/templates/test_result.mako
index 229a5a7..ff08797 100644
--- a/templates/test_result.mako
+++ b/templates/test_result.mako
@@ -75,6 +75,14 @@
           </pre>${value.command}</pre>
         </td>
       </tr>
+    % if value.exception:
+      <tr>
+        <td>Exception</td>
+        <td>
+          <pre>${value.exception | h}</pre>
+        </td>
+      </tr>
+    % endif
     % if value.traceback:
       <tr>
         <td>Traceback</td>
-- 
2.5.0



More information about the Piglit mailing list