summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-11-23 11:58:21 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-23 12:05:22 +0000
commit0e2d84728bc625b5055bbc0512ae2cd06cd45dcf (patch)
tree8293280685542a2e688495b9bd722f6d6bc2b862
parentfa4742f585e79d82ef29aa6ebc0536dd44307695 (diff)
downloadpoky-0e2d84728bc625b5055bbc0512ae2cd06cd45dcf.tar.gz
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>
-rw-r--r--meta/lib/oeqa/buildperf/base.py25
1 files changed, 10 insertions, 15 deletions
diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py
index b82476c110..92f3e451a3 100644
--- a/meta/lib/oeqa/buildperf/base.py
+++ b/meta/lib/oeqa/buildperf/base.py
@@ -173,18 +173,13 @@ class BuildPerfTestResult(unittest.TextTestResult):
173 self.elapsed_time = datetime.utcnow() - self.start_time 173 self.elapsed_time = datetime.utcnow() - self.start_time
174 174
175 def all_results(self): 175 def all_results(self):
176 result_map = {'SUCCESS': self.successes, 176 compound = [('SUCCESS', t, None) for t in self.successes] + \
177 'FAILURE': self.failures, 177 [('FAILURE', t, m) for t, m in self.failures] + \
178 'ERROR': self.errors, 178 [('ERROR', t, m) for t, m in self.errors] + \
179 'EXPECTED_FAILURE': self.expectedFailures, 179 [('EXPECTED_FAILURE', t, m) for t, m in self.expectedFailures] + \
180 'UNEXPECTED_SUCCESS': self.unexpectedSuccesses, 180 [('UNEXPECTED_SUCCESS', t, None) for t in self.unexpectedSuccesses] + \
181 'SKIPPED': self.skipped} 181 [('SKIPPED', t, m) for t, m in self.skipped]
182 for status, tests in result_map.items(): 182 return sorted(compound, key=lambda info: info[1].start_time)
183 for test in tests:
184 if isinstance(test, tuple):
185 yield (status, test)
186 else:
187 yield (status, (test, None))
188 183
189 184
190 def update_globalres_file(self, filename): 185 def update_globalres_file(self, filename):
@@ -205,7 +200,7 @@ class BuildPerfTestResult(unittest.TextTestResult):
205 git_tag_rev = self.git_commit 200 git_tag_rev = self.git_commit
206 201
207 values = ['0'] * 12 202 values = ['0'] * 12
208 for status, (test, msg) in self.all_results(): 203 for status, test, _ in self.all_results():
209 if status in ['ERROR', 'SKIPPED']: 204 if status in ['ERROR', 'SKIPPED']:
210 continue 205 continue
211 (t_ind, t_len), (s_ind, s_len) = gr_map[test.name] 206 (t_ind, t_len), (s_ind, s_len) = gr_map[test.name]
@@ -233,7 +228,7 @@ class BuildPerfTestResult(unittest.TextTestResult):
233 'elapsed_time': self.elapsed_time} 228 'elapsed_time': self.elapsed_time}
234 229
235 tests = {} 230 tests = {}
236 for status, (test, reason) in self.all_results(): 231 for status, test, reason in self.all_results():
237 tests[test.name] = {'name': test.name, 232 tests[test.name] = {'name': test.name,
238 'description': test.shortDescription(), 233 'description': test.shortDescription(),
239 'status': status, 234 'status': status,
@@ -268,7 +263,7 @@ class BuildPerfTestResult(unittest.TextTestResult):
268 suite.set('skipped', str(len(self.skipped))) 263 suite.set('skipped', str(len(self.skipped)))
269 264
270 test_cnt = 0 265 test_cnt = 0
271 for status, (test, reason) in self.all_results(): 266 for status, test, reason in self.all_results():
272 test_cnt += 1 267 test_cnt += 1
273 testcase = ET.SubElement(suite, 'testcase') 268 testcase = ET.SubElement(suite, 'testcase')
274 testcase.set('classname', test.__module__ + '.' + test.__class__.__name__) 269 testcase.set('classname', test.__module__ + '.' + test.__class__.__name__)