[Telemetry] Move failure reasoning into summary.py.

Previously, we were having Summary take a boolean had_failures. Now that
failures are part of Telemetry's value system, it is easy to have Summary
reason about how to summarize values when failures and/or skips are present.
This CL is the first step: it eliminates had_failures from being passed around
and instead computes it directly based on the presence of failures in the
passed list of page-specific values.

Review URL: https://codereview.chromium.org/465063002

Cr-Commit-Position: refs/heads/master@{#289556}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289556 0039d316-1c4b-4281-b951-d872f2087c98
parent f0977fde
...@@ -31,8 +31,7 @@ class BuildbotOutputFormatter(output_formatter.OutputFormatter): ...@@ -31,8 +31,7 @@ class BuildbotOutputFormatter(output_formatter.OutputFormatter):
# Print out the list of unique pages. # Print out the list of unique pages.
perf_tests_helper.PrintPages( perf_tests_helper.PrintPages(
[page.display_name for page in page_test_results.pages_that_succeeded]) [page.display_name for page in page_test_results.pages_that_succeeded])
summary = summary_module.Summary(page_test_results.all_page_specific_values, summary = summary_module.Summary(page_test_results.all_page_specific_values)
had_failures)
for value in summary.interleaved_computed_per_page_values_and_summaries: for value in summary.interleaved_computed_per_page_values_and_summaries:
if value.page: if value.page:
self._PrintComputedPerPageValue(value) self._PrintComputedPerPageValue(value)
......
...@@ -35,7 +35,9 @@ class Summary(object): ...@@ -35,7 +35,9 @@ class Summary(object):
] ]
""" """
def __init__(self, all_page_specific_values, had_failures): def __init__(self, all_page_specific_values):
had_failures = any(isinstance(v, failure.FailureValue) for v in
all_page_specific_values)
self.had_failures = had_failures self.had_failures = had_failures
self._computed_per_page_values = [] self._computed_per_page_values = []
self._computed_summary_values = [] self._computed_summary_values = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment