diff options
Diffstat (limited to 'scripts/lib/resulttool/report.py')
-rw-r--r-- | scripts/lib/resulttool/report.py | 18 |
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 | ||
252 | def report(args, logger): | 263 | def 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 | ||
257 | def register_commands(subparsers): | 269 | def 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 | ||