mirror of
https://git.yoctoproject.org/poky
synced 2026-05-31 12:49:46 +00:00
resulttool/report: Handle missing metadata sections more cleanly
Currently some older results files cause the code to give tracebacks. Handle these missing sections more cleanly. (From OE-Core rev: 93b87a9a7056fb507a585c454cef8db7194d7393) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -31,9 +31,12 @@ class ResultsTextReport(object):
|
|||||||
def handle_ptest_result(self, k, status, result):
|
def handle_ptest_result(self, k, status, result):
|
||||||
if k == 'ptestresult.sections':
|
if k == 'ptestresult.sections':
|
||||||
return
|
return
|
||||||
_, suite, test = k.split(".", 2)
|
try:
|
||||||
|
_, suite, test = k.split(".", 2)
|
||||||
|
except ValueError:
|
||||||
|
return
|
||||||
# Handle 'glib-2.0'
|
# Handle 'glib-2.0'
|
||||||
if suite not in result['ptestresult.sections']:
|
if 'ptestresult.sections' in result and suite not in result['ptestresult.sections']:
|
||||||
try:
|
try:
|
||||||
_, suite, suite1, test = k.split(".", 3)
|
_, suite, suite1, test = k.split(".", 3)
|
||||||
if suite + "." + suite1 in result['ptestresult.sections']:
|
if suite + "." + suite1 in result['ptestresult.sections']:
|
||||||
@@ -45,7 +48,7 @@ class ResultsTextReport(object):
|
|||||||
for tk in self.result_types:
|
for tk in self.result_types:
|
||||||
if status in self.result_types[tk]:
|
if status in self.result_types[tk]:
|
||||||
self.ptests[suite][tk] += 1
|
self.ptests[suite][tk] += 1
|
||||||
if suite in result['ptestresult.sections']:
|
if 'ptestresult.sections' in result and suite in result['ptestresult.sections']:
|
||||||
if 'duration' in result['ptestresult.sections'][suite]:
|
if 'duration' in result['ptestresult.sections'][suite]:
|
||||||
self.ptests[suite]['duration'] = result['ptestresult.sections'][suite]['duration']
|
self.ptests[suite]['duration'] = result['ptestresult.sections'][suite]['duration']
|
||||||
if 'timeout' in result['ptestresult.sections'][suite]:
|
if 'timeout' in result['ptestresult.sections'][suite]:
|
||||||
|
|||||||
Reference in New Issue
Block a user