Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1114)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py

Issue 2446463002: Fetch retry summary and use it to determine what tests to rebaseline. (Closed)
Patch Set: Add test for case where no retry summary can be downloaded Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py
index 03267c4e376e540782b4d1f51e53c097fa9884ac..59478e4ddccc58af351592ea9f0779246ab96675 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py
@@ -8,6 +8,7 @@ This command interacts with the Rietveld API to get information about try jobs
with layout test results.
"""
+import json
import logging
import optparse
@@ -183,7 +184,7 @@ class RebaselineCL(AbstractParallelRebaselineCommand):
return self._tool.builders.all_try_builder_names()
def _tests_to_rebaseline(self, build):
- """Fetches a list of LayoutTestResult objects for unexpected results with new baselines."""
+ """Fetches a list of tests that should be rebaselined."""
buildbot = self._tool.buildbot
results_url = buildbot.results_url(build.builder_name, build.build_number)
layout_test_results = buildbot.fetch_layout_test_results(results_url)
@@ -192,7 +193,27 @@ class RebaselineCL(AbstractParallelRebaselineCommand):
return []
failure_results = layout_test_results.unexpected_mismatch_results()
missing_results = layout_test_results.missing_results()
- return sorted(r.test_name() for r in failure_results + missing_results)
+ tests = sorted(r.test_name() for r in failure_results + missing_results)
+
+ new_failures = self._fetch_tests_with_new_failures(build)
+ if new_failures is None:
+ _log.warning('No retry summary available for build %s.', build)
+ else:
+ tests = [t for t in tests if t in new_failures]
+ return tests
+
+ def _fetch_tests_with_new_failures(self, build):
+ """Fetches a list of tests that failed with a patch in a given try job but not without."""
+ buildbot = self._tool.buildbot
+ content = buildbot.fetch_retry_summary_json(build)
+ if content is None:
+ return None
+ try:
+ retry_summary = json.loads(content)
+ return retry_summary['failures']
+ except (ValueError, KeyError):
+ _log.warning('Unexepected retry summary content:\n%s', content)
+ return None
@staticmethod
def _log_test_prefix_list(test_prefix_list):
@@ -200,7 +221,8 @@ class RebaselineCL(AbstractParallelRebaselineCommand):
if not test_prefix_list:
_log.info('No tests to rebaseline; exiting.')
return
- _log.info('Tests to rebaseline:')
+ _log.debug('Tests to rebaseline:')
for test, builds in test_prefix_list.iteritems():
- builds_str = ', '.join(sorted('%s (%s)' % (b.builder_name, b.build_number) for b in builds))
- _log.info(' %s: %s', test, builds_str)
+ _log.debug(' %s:', test)
+ for build in sorted(builds):
+ _log.debug(' %s', build)

Powered by Google App Engine
This is Rietveld 408576698