summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-27 16:51:56 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-03-26 15:38:23 +0000
commit4b5686a0fd220fd97bb7a205d746f27cb8d21ce2 (patch)
treee447736bd0da5242c67faa5732e2092f36066b1c /scripts
parent3cbd483c42e57862a38967803d718a525fad639d (diff)
downloadpoky-4b5686a0fd220fd97bb7a205d746f27cb8d21ce2.tar.gz
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>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/resulttool/report.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/lib/resulttool/report.py b/scripts/lib/resulttool/report.py
index 2f5ea308e2..5ffe262f89 100644
--- a/scripts/lib/resulttool/report.py
+++ b/scripts/lib/resulttool/report.py
@@ -31,9 +31,12 @@ class ResultsTextReport(object):
31 def handle_ptest_result(self, k, status, result): 31 def handle_ptest_result(self, k, status, result):
32 if k == 'ptestresult.sections': 32 if k == 'ptestresult.sections':
33 return 33 return
34 _, suite, test = k.split(".", 2) 34 try:
35 _, suite, test = k.split(".", 2)
36 except ValueError:
37 return
35 # Handle 'glib-2.0' 38 # Handle 'glib-2.0'
36 if suite not in result['ptestresult.sections']: 39 if 'ptestresult.sections' in result and suite not in result['ptestresult.sections']:
37 try: 40 try:
38 _, suite, suite1, test = k.split(".", 3) 41 _, suite, suite1, test = k.split(".", 3)
39 if suite + "." + suite1 in result['ptestresult.sections']: 42 if suite + "." + suite1 in result['ptestresult.sections']:
@@ -45,7 +48,7 @@ class ResultsTextReport(object):
45 for tk in self.result_types: 48 for tk in self.result_types:
46 if status in self.result_types[tk]: 49 if status in self.result_types[tk]:
47 self.ptests[suite][tk] += 1 50 self.ptests[suite][tk] += 1
48 if suite in result['ptestresult.sections']: 51 if 'ptestresult.sections' in result and suite in result['ptestresult.sections']:
49 if 'duration' in result['ptestresult.sections'][suite]: 52 if 'duration' in result['ptestresult.sections'][suite]:
50 self.ptests[suite]['duration'] = result['ptestresult.sections'][suite]['duration'] 53 self.ptests[suite]['duration'] = result['ptestresult.sections'][suite]['duration']
51 if 'timeout' in result['ptestresult.sections'][suite]: 54 if 'timeout' in result['ptestresult.sections'][suite]: