summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYeoh Ee Peng <ee.peng.yeoh@intel.com>2019-11-07 17:50:28 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-11-14 13:20:59 +0000
commit565b05b0e477610468f24b2914f576b66309ab7d (patch)
treeb261edd90b58d5030b1cb2ecdbb95c9dcead1889
parent3adefee2a152561cf05aa6538e2b0bee2815e09d (diff)
downloadpoky-565b05b0e477610468f24b2914f576b66309ab7d.tar.gz
scripts/resulttool/report: Enable output raw test results
In case of debugging, report user need to acccess the raw test result. Instead of going back to source file/directory/URL to manually pull out the raw result, provide alternative way to let report showing raw test results by providing the result id (optional). (From OE-Core rev: 8b2485bc0d0fa2f72b37e8bafbfa663d456ea98c) Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/resulttool/report.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/scripts/lib/resulttool/report.py b/scripts/lib/resulttool/report.py
index d2d4d1b59d..0c83fb6a74 100644
--- a/scripts/lib/resulttool/report.py
+++ b/scripts/lib/resulttool/report.py
@@ -207,7 +207,7 @@ class ResultsTextReport(object):
207 maxlen=maxlen) 207 maxlen=maxlen)
208 print(output) 208 print(output)
209 209
210 def view_test_report(self, logger, source_dir, branch, commit, tag, use_regression_map): 210 def view_test_report(self, logger, source_dir, branch, commit, tag, use_regression_map, raw_test):
211 test_count_reports = [] 211 test_count_reports = []
212 configmap = resultutils.store_map 212 configmap = resultutils.store_map
213 if use_regression_map: 213 if use_regression_map:
@@ -225,6 +225,17 @@ class ResultsTextReport(object):
225 testresults = resultutils.git_get_result(repo, [tag], configmap=configmap) 225 testresults = resultutils.git_get_result(repo, [tag], configmap=configmap)
226 else: 226 else:
227 testresults = resultutils.load_resultsdata(source_dir, configmap=configmap) 227 testresults = resultutils.load_resultsdata(source_dir, configmap=configmap)
228 if raw_test:
229 raw_results = {}
230 for testsuite in testresults:
231 result = testresults[testsuite].get(raw_test, {})
232 if result:
233 raw_results[testsuite] = result
234 if raw_results:
235 print(json.dumps(raw_results, sort_keys=True, indent=4))
236 else:
237 print('Could not find raw test result for %s' % raw_test)
238 return 0
228 for testsuite in testresults: 239 for testsuite in testresults:
229 for resultid in testresults[testsuite]: 240 for resultid in testresults[testsuite]:
230 skip = False 241 skip = False
@@ -251,7 +262,8 @@ class ResultsTextReport(object):
251 262
252def report(args, logger): 263def report(args, logger):
253 report = ResultsTextReport() 264 report = ResultsTextReport()
254 report.view_test_report(logger, args.source_dir, args.branch, args.commit, args.tag, args.use_regression_map) 265 report.view_test_report(logger, args.source_dir, args.branch, args.commit, args.tag, args.use_regression_map,
266 args.raw_test_only)
255 return 0 267 return 0
256 268
257def register_commands(subparsers): 269def register_commands(subparsers):
@@ -268,4 +280,6 @@ def register_commands(subparsers):
268 help='source_dir is a git repository, report on the tag specified from that repository') 280 help='source_dir is a git repository, report on the tag specified from that repository')
269 parser_build.add_argument('-m', '--use_regression_map', action='store_true', 281 parser_build.add_argument('-m', '--use_regression_map', action='store_true',
270 help='instead of the default "store_map", use the "regression_map" for report') 282 help='instead of the default "store_map", use the "regression_map" for report')
283 parser_build.add_argument('-r', '--raw_test_only', default='',
284 help='output raw test result only for the user provided test result id')
271 285