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:27 +0000
commit652b5024568f3a5015e35eed408ea8705f3997e3 (patch)
tree35874d571f38054a378395d6c7ab1b0d18279bb0 /scripts
parenta1a31bb8568e7413404a59347f76b7e6ee404e54 (diff)
downloadpoky-652b5024568f3a5015e35eed408ea8705f3997e3.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: 829754c380ca2b614afa23500e53a8c5b850932f) 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]: