aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-11-03 10:41:34 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-23 12:05:21 +0000
commit96fcb0f7b4a8a59a1620e48a65a9cda8cf03d71f (patch)
tree7e63e40c54a5ae05d8e7e0e422779939d60f96c0 /meta/lib
parent184afbc6ce13ab2102675274beaa1b2395d9273f (diff)
downloadopenembedded-core-contrib-96fcb0f7b4a8a59a1620e48a65a9cda8cf03d71f.tar.gz
oeqa.buildperf: include error details in json report
This will typically mean assert message and exception type plus a traceback. In case of skipped tests the reason (i.e. skip message) is included. [YOCTO #10590] (From OE-Core rev: bd5f5ab6f7350b4487c9cc2dbd100fa4b687d0fa) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/buildperf/base.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py
index 71f3382d0b..668e822018 100644
--- a/meta/lib/oeqa/buildperf/base.py
+++ b/meta/lib/oeqa/buildperf/base.py
@@ -139,6 +139,21 @@ class BuildPerfTestResult(unittest.TextTestResult):
super(BuildPerfTestResult, self).addSuccess(test)
self.successes.append(test)
+ def addError(self, test, err):
+ """Record results from crashed test"""
+ test.err = err
+ super(BuildPerfTestResult, self).addError(test, err)
+
+ def addFailure(self, test, err):
+ """Record results from failed test"""
+ test.err = err
+ super(BuildPerfTestResult, self).addFailure(test, err)
+
+ def addExpectedFailure(self, test, err):
+ """Record results from expectedly failed test"""
+ test.err = err
+ super(BuildPerfTestResult, self).addExpectedFailure(test, err)
+
def startTest(self, test):
"""Pre-test hook"""
test.base_dir = self.out_dir
@@ -226,6 +241,13 @@ class BuildPerfTestResult(unittest.TextTestResult):
'cmd_log_file': os.path.relpath(test.cmd_log_file,
self.out_dir),
'measurements': test.measurements}
+ if status in ('ERROR', 'FAILURE', 'EXPECTED_FAILURE'):
+ tests[test.name]['message'] = str(test.err[1])
+ tests[test.name]['err_type'] = test.err[0].__name__
+ tests[test.name]['err_output'] = reason
+ elif reason:
+ tests[test.name]['message'] = reason
+
results['tests'] = tests
with open(os.path.join(self.out_dir, 'results.json'), 'w') as fobj:
@@ -307,6 +329,8 @@ class BuildPerfTestCase(unittest.TestCase):
self.start_time = None
self.elapsed_time = None
self.measurements = []
+ # self.err is supposed to be a tuple from sys.exc_info()
+ self.err = None
self.bb_vars = get_bb_vars()
# TODO: remove 'times' and 'sizes' arrays when globalres support is
# removed