diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-11-03 10:41:34 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-23 12:05:21 +0000 |
commit | 96fcb0f7b4a8a59a1620e48a65a9cda8cf03d71f (patch) | |
tree | 7e63e40c54a5ae05d8e7e0e422779939d60f96c0 /meta/lib/oeqa/buildperf/base.py | |
parent | 184afbc6ce13ab2102675274beaa1b2395d9273f (diff) | |
download | poky-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/oeqa/buildperf/base.py')
-rw-r--r-- | meta/lib/oeqa/buildperf/base.py | 24 |
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): | |||
139 | super(BuildPerfTestResult, self).addSuccess(test) | 139 | super(BuildPerfTestResult, self).addSuccess(test) |
140 | self.successes.append(test) | 140 | self.successes.append(test) |
141 | 141 | ||
142 | def addError(self, test, err): | ||
143 | """Record results from crashed test""" | ||
144 | test.err = err | ||
145 | super(BuildPerfTestResult, self).addError(test, err) | ||
146 | |||
147 | def addFailure(self, test, err): | ||
148 | """Record results from failed test""" | ||
149 | test.err = err | ||
150 | super(BuildPerfTestResult, self).addFailure(test, err) | ||
151 | |||
152 | def addExpectedFailure(self, test, err): | ||
153 | """Record results from expectedly failed test""" | ||
154 | test.err = err | ||
155 | super(BuildPerfTestResult, self).addExpectedFailure(test, err) | ||
156 | |||
142 | def startTest(self, test): | 157 | def startTest(self, test): |
143 | """Pre-test hook""" | 158 | """Pre-test hook""" |
144 | test.base_dir = self.out_dir | 159 | test.base_dir = self.out_dir |
@@ -226,6 +241,13 @@ class BuildPerfTestResult(unittest.TextTestResult): | |||
226 | 'cmd_log_file': os.path.relpath(test.cmd_log_file, | 241 | 'cmd_log_file': os.path.relpath(test.cmd_log_file, |
227 | self.out_dir), | 242 | self.out_dir), |
228 | 'measurements': test.measurements} | 243 | 'measurements': test.measurements} |
244 | if status in ('ERROR', 'FAILURE', 'EXPECTED_FAILURE'): | ||
245 | tests[test.name]['message'] = str(test.err[1]) | ||
246 | tests[test.name]['err_type'] = test.err[0].__name__ | ||
247 | tests[test.name]['err_output'] = reason | ||
248 | elif reason: | ||
249 | tests[test.name]['message'] = reason | ||
250 | |||
229 | results['tests'] = tests | 251 | results['tests'] = tests |
230 | 252 | ||
231 | with open(os.path.join(self.out_dir, 'results.json'), 'w') as fobj: | 253 | with open(os.path.join(self.out_dir, 'results.json'), 'w') as fobj: |
@@ -307,6 +329,8 @@ class BuildPerfTestCase(unittest.TestCase): | |||
307 | self.start_time = None | 329 | self.start_time = None |
308 | self.elapsed_time = None | 330 | self.elapsed_time = None |
309 | self.measurements = [] | 331 | self.measurements = [] |
332 | # self.err is supposed to be a tuple from sys.exc_info() | ||
333 | self.err = None | ||
310 | self.bb_vars = get_bb_vars() | 334 | self.bb_vars = get_bb_vars() |
311 | # TODO: remove 'times' and 'sizes' arrays when globalres support is | 335 | # TODO: remove 'times' and 'sizes' arrays when globalres support is |
312 | # removed | 336 | # removed |