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-02-27 18:04:14 +0000
commit43f793b78d64f08aa1a74d5d4fe54471c29646b9 (patch)
tree839089ccd7cdcbc94c72b5e162ff774684b814f9 /scripts
parentd8f276b2cb6636f9e089cfb09b0f614f3ee42634 (diff)
downloadpoky-43f793b78d64f08aa1a74d5d4fe54471c29646b9.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: f778c191dbd5740173b3be07f4c1655d85a07bb2) 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]: