1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +00:00

oeqa.buildperf: report results in chronological order

Write results in the report file in chronological order, instead of
random order dependent on test statuses.

[YOCTO #10590]

(From OE-Core rev: 91ba6ea9fe2eb82f992a6516d7971b435e1cfd32)

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>
This commit is contained in:
Markus Lehtonen
2016-11-23 11:58:21 +02:00
committed by Richard Purdie
parent fa4742f585
commit 0e2d84728b
+10 -15
View File
@@ -173,18 +173,13 @@ class BuildPerfTestResult(unittest.TextTestResult):
self.elapsed_time = datetime.utcnow() - self.start_time self.elapsed_time = datetime.utcnow() - self.start_time
def all_results(self): def all_results(self):
result_map = {'SUCCESS': self.successes, compound = [('SUCCESS', t, None) for t in self.successes] + \
'FAILURE': self.failures, [('FAILURE', t, m) for t, m in self.failures] + \
'ERROR': self.errors, [('ERROR', t, m) for t, m in self.errors] + \
'EXPECTED_FAILURE': self.expectedFailures, [('EXPECTED_FAILURE', t, m) for t, m in self.expectedFailures] + \
'UNEXPECTED_SUCCESS': self.unexpectedSuccesses, [('UNEXPECTED_SUCCESS', t, None) for t in self.unexpectedSuccesses] + \
'SKIPPED': self.skipped} [('SKIPPED', t, m) for t, m in self.skipped]
for status, tests in result_map.items(): return sorted(compound, key=lambda info: info[1].start_time)
for test in tests:
if isinstance(test, tuple):
yield (status, test)
else:
yield (status, (test, None))
def update_globalres_file(self, filename): def update_globalres_file(self, filename):
@@ -205,7 +200,7 @@ class BuildPerfTestResult(unittest.TextTestResult):
git_tag_rev = self.git_commit git_tag_rev = self.git_commit
values = ['0'] * 12 values = ['0'] * 12
for status, (test, msg) in self.all_results(): for status, test, _ in self.all_results():
if status in ['ERROR', 'SKIPPED']: if status in ['ERROR', 'SKIPPED']:
continue continue
(t_ind, t_len), (s_ind, s_len) = gr_map[test.name] (t_ind, t_len), (s_ind, s_len) = gr_map[test.name]
@@ -233,7 +228,7 @@ class BuildPerfTestResult(unittest.TextTestResult):
'elapsed_time': self.elapsed_time} 'elapsed_time': self.elapsed_time}
tests = {} tests = {}
for status, (test, reason) in self.all_results(): for status, test, reason in self.all_results():
tests[test.name] = {'name': test.name, tests[test.name] = {'name': test.name,
'description': test.shortDescription(), 'description': test.shortDescription(),
'status': status, 'status': status,
@@ -268,7 +263,7 @@ class BuildPerfTestResult(unittest.TextTestResult):
suite.set('skipped', str(len(self.skipped))) suite.set('skipped', str(len(self.skipped)))
test_cnt = 0 test_cnt = 0
for status, (test, reason) in self.all_results(): for status, test, reason in self.all_results():
test_cnt += 1 test_cnt += 1
testcase = ET.SubElement(suite, 'testcase') testcase = ET.SubElement(suite, 'testcase')
testcase.set('classname', test.__module__ + '.' + test.__class__.__name__) testcase.set('classname', test.__module__ + '.' + test.__class__.__name__)