Index: third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_from_try_jobs.py |
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_from_try_jobs.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_from_try_jobs.py |
index 1affaef23677d2ceae84a393e9891358cd52d775..d8617bb75d0a1d182c0f4749e4ec234b664e69d2 100644 |
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_from_try_jobs.py |
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_from_try_jobs.py |
@@ -16,7 +16,6 @@ |
from webkitpy.common.net.web import Web |
from webkitpy.layout_tests.models.test_expectations import BASELINE_SUFFIX_LIST |
from webkitpy.tool.commands.rebaseline import AbstractParallelRebaselineCommand |
-from webkitpy.tool.commands.rebaseline import Build |
_log = logging.getLogger(__name__) |
@@ -47,9 +46,9 @@ |
if args: |
test_prefix_list = {} |
try_jobs = latest_try_jobs(issue_number, self._try_bots(), self.web) |
- builds = [Build(j.builder_name, j.build_number) for j in try_jobs] |
+ builders = [j.builder_name for j in try_jobs] |
for t in args: |
- test_prefix_list[t] = {b: BASELINE_SUFFIX_LIST for b in builds} |
+ test_prefix_list[t] = {b: BASELINE_SUFFIX_LIST for b in builders} |
else: |
test_prefix_list = self._test_prefix_list(issue_number) |
self._log_test_prefix_list(test_prefix_list) |
@@ -77,27 +76,27 @@ |
def _test_prefix_list(self, issue_number): |
"""Returns a collection of test, builder and file extensions to get new baselines for.""" |
- builds_to_tests = self._builds_to_tests(issue_number) |
+ builders_to_tests = self._builders_to_tests(issue_number) |
result = {} |
- for build, tests in builds_to_tests.iteritems(): |
+ for builder, tests in builders_to_tests.iteritems(): |
for test in tests: |
if test not in result: |
result[test] = {} |
- result[test][build] = BASELINE_SUFFIX_LIST |
+ # TODO(qyearsley): Consider using TestExpectations.suffixes_for_test_result. |
+ result[test][builder] = BASELINE_SUFFIX_LIST |
return result |
- def _builds_to_tests(self, issue_number): |
+ def _builders_to_tests(self, issue_number): |
"""Fetches a list of try bots, and for each, fetches tests with new baselines.""" |
_log.debug('Getting results for Rietveld issue %d.' % issue_number) |
try_jobs = latest_try_jobs(issue_number, self._try_bots(), self.web) |
if not try_jobs: |
_log.debug('No try job results for builders in: %r.' % (self._try_bots(),)) |
- builds_to_tests = {} |
+ builders_to_tests = {} |
for job in try_jobs: |
test_results = self._unexpected_mismatch_results(job) |
- build = Build(job.builder_name, job.build_number) |
- builds_to_tests[build] = sorted(r.test_name() for r in test_results) |
- return builds_to_tests |
+ builders_to_tests[job.builder_name] = sorted(r.test_name() for r in test_results) |
+ return builders_to_tests |
def _try_bots(self): |
"""Retuns a collection of try bot builders to fetch results for.""" |
@@ -120,6 +119,5 @@ |
_log.info('No tests to rebaseline.') |
return |
_log.info('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) |
+ for test, builders in test_prefix_list.iteritems(): |
+ _log.info(' %s: %s', test, ', '.join(sorted(builders))) |