| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """A command to fetch new baselines from try jobs for the current CL.""" | 5 """A command to fetch new baselines from try jobs for the current CL.""" |
| 6 | 6 |
| 7 import json | 7 import json |
| 8 import logging | 8 import logging |
| 9 import optparse | 9 import optparse |
| 10 | 10 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 Returns: | 147 Returns: |
| 148 A dict mapping Build to LayoutTestResults, or None if any results | 148 A dict mapping Build to LayoutTestResults, or None if any results |
| 149 were not available. | 149 were not available. |
| 150 """ | 150 """ |
| 151 buildbot = self._tool.buildbot | 151 buildbot = self._tool.buildbot |
| 152 results = {} | 152 results = {} |
| 153 for build in builds: | 153 for build in builds: |
| 154 results_url = buildbot.results_url(build.builder_name, build.build_n
umber) | 154 results_url = buildbot.results_url(build.builder_name, build.build_n
umber) |
| 155 layout_test_results = buildbot.fetch_results(build) | 155 layout_test_results = buildbot.fetch_results(build) |
| 156 if layout_test_results is None: | 156 if layout_test_results is None: |
| 157 _log.error( | 157 _log.error('Failed to fetch results for: %s', build) |
| 158 'Failed to fetch results from "%s".\n' | 158 _log.error('Results were expected to exist at:\n%s/results.html'
, results_url) |
| 159 'Try starting a new job for %s by running :\n' | 159 _log.error('If the job failed, you could retry by running:\ngit
cl try -b %s', build.builder_name) |
| 160 ' git cl try -b %s', | |
| 161 results_url, build.builder_name, build.builder_name) | |
| 162 return None | 160 return None |
| 163 results[build] = layout_test_results | 161 results[build] = layout_test_results |
| 164 return results | 162 return results |
| 165 | 163 |
| 166 def _test_prefix_list(self, builds_to_results, only_changed_tests): | 164 def _test_prefix_list(self, builds_to_results, only_changed_tests): |
| 167 """Returns a dict which lists the set of baselines to fetch. | 165 """Returns a dict which lists the set of baselines to fetch. |
| 168 | 166 |
| 169 The dict that is returned is a dict of tests to Build objects | 167 The dict that is returned is a dict of tests to Build objects |
| 170 to baseline file extensions. | 168 to baseline file extensions. |
| 171 | 169 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 def _log_test_prefix_list(test_prefix_list): | 226 def _log_test_prefix_list(test_prefix_list): |
| 229 """Logs the tests to download new baselines for.""" | 227 """Logs the tests to download new baselines for.""" |
| 230 if not test_prefix_list: | 228 if not test_prefix_list: |
| 231 _log.info('No tests to rebaseline; exiting.') | 229 _log.info('No tests to rebaseline; exiting.') |
| 232 return | 230 return |
| 233 _log.debug('Tests to rebaseline:') | 231 _log.debug('Tests to rebaseline:') |
| 234 for test, builds in test_prefix_list.iteritems(): | 232 for test, builds in test_prefix_list.iteritems(): |
| 235 _log.debug(' %s:', test) | 233 _log.debug(' %s:', test) |
| 236 for build in sorted(builds): | 234 for build in sorted(builds): |
| 237 _log.debug(' %s', build) | 235 _log.debug(' %s', build) |
| OLD | NEW |