aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaroline Tice <cmtice@google.com>2017-04-06 14:05:40 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-04-08 19:40:21 -0700
commit9a47f6ba1f3f0acefec53ea6dbdd66120b10f4c6 (patch)
treef582e3d2c2772726d308f42ff274835e8f80306f
parentf6ef4395fe1896ba68c80e52cb24763b0fcfe7f8 (diff)
downloadtoolchain-utils-9a47f6ba1f3f0acefec53ea6dbdd66120b10f4c6.tar.gz
[crosperf] Fix status reporting for multiple iters inside a single run.
If a single benchmark run contains multiple iterations (like BootPerfServer), then only the first internal iteration was getting the correct pass/fail status, so even though everything passed the report title would claim 1 pass and 9 fails (for 10 internal iterations). This fixes that. BUG=chromium:426960 TEST=Ran BootPerfServer with change. Now shows correct number of passes/fails for the iterations. Change-Id: I9638b39c94692fd754698e64d89cb22c10e9d479 Reviewed-on: https://chromium-review.googlesource.com/470547 Commit-Ready: Caroline Tice <cmtice@chromium.org> Tested-by: Caroline Tice <cmtice@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Reviewed-by: Yunlian Jiang <yunlian@chromium.org>
-rw-r--r--crosperf/results_organizer.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/crosperf/results_organizer.py b/crosperf/results_organizer.py
index 62972027..b7641854 100644
--- a/crosperf/results_organizer.py
+++ b/crosperf/results_organizer.py
@@ -47,6 +47,17 @@ def _Repeat(func, times):
return [func() for _ in xrange(times)]
+def _DictWithReturnValues(retval, pass_fail):
+ """Create a new dictionary pre-populated with success/fail values."""
+ new_dict = {}
+ # Note: 0 is a valid retval; test to make sure it's not None.
+ if retval is not None:
+ new_dict['retval'] = retval
+ if pass_fail:
+ new_dict[''] = pass_fail
+ return new_dict
+
+
def _GetNonDupLabel(max_dup, runs):
"""Create new list for the runs of the same label.
@@ -61,8 +72,12 @@ def _GetNonDupLabel(max_dup, runs):
"""
new_runs = []
for run in runs:
+ run_retval = run.get('retval', None)
+ run_pass_fail = run.get('', None)
new_run = {}
- added_runs = _Repeat(dict, max_dup)
+ # pylint: disable=cell-var-from-loop
+ added_runs = _Repeat(
+ lambda: _DictWithReturnValues(run_retval, run_pass_fail), max_dup)
for key, value in run.iteritems():
match = _DUP_KEY_REGEX.match(key)
if not match: