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 a Rietveld issue. | 5 """A command to fetch new baselines from try jobs for a Rietveld issue. |
6 | 6 |
7 This command interacts with the Rietveld API to get information about try jobs | 7 This command interacts with the Rietveld API to get information about try jobs |
8 with layout test results. | 8 with layout test results. |
9 """ | 9 """ |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 help='Only download new baselines for tests that are changed in
the CL.'), | 46 help='Only download new baselines for tests that are changed in
the CL.'), |
47 optparse.make_option( | 47 optparse.make_option( |
48 '--no-trigger-jobs', dest='trigger_jobs', action='store_false',
default=True, | 48 '--no-trigger-jobs', dest='trigger_jobs', action='store_false',
default=True, |
49 help='Do not trigger any try jobs.'), | 49 help='Do not trigger any try jobs.'), |
50 self.no_optimize_option, | 50 self.no_optimize_option, |
51 self.results_directory_option, | 51 self.results_directory_option, |
52 ]) | 52 ]) |
53 self.rietveld = Rietveld(Web()) | 53 self.rietveld = Rietveld(Web()) |
54 | 54 |
55 def execute(self, options, args, tool): | 55 def execute(self, options, args, tool): |
| 56 self._tool = tool |
56 issue_number = self._get_issue_number(options) | 57 issue_number = self._get_issue_number(options) |
57 if not issue_number: | 58 if not issue_number: |
58 return | 59 return |
59 | 60 |
60 builds = self.rietveld.latest_try_jobs(issue_number, self._try_bots()) | 61 builds = self.rietveld.latest_try_jobs(issue_number, self._try_bots()) |
61 if options.trigger_jobs: | 62 if options.trigger_jobs: |
62 self.trigger_jobs_for_missing_builds(builds) | 63 self.trigger_jobs_for_missing_builds(builds) |
63 | 64 |
64 if args: | 65 if args: |
65 test_prefix_list = {} | 66 test_prefix_list = {} |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 @staticmethod | 161 @staticmethod |
161 def _log_test_prefix_list(test_prefix_list): | 162 def _log_test_prefix_list(test_prefix_list): |
162 """Logs the tests to download new baselines for.""" | 163 """Logs the tests to download new baselines for.""" |
163 if not test_prefix_list: | 164 if not test_prefix_list: |
164 _log.info('No tests to rebaseline.') | 165 _log.info('No tests to rebaseline.') |
165 return | 166 return |
166 _log.info('Tests to rebaseline:') | 167 _log.info('Tests to rebaseline:') |
167 for test, builds in test_prefix_list.iteritems(): | 168 for test, builds in test_prefix_list.iteritems(): |
168 builds_str = ', '.join(sorted('%s (%s)' % (b.builder_name, b.build_n
umber) for b in builds)) | 169 builds_str = ', '.join(sorted('%s (%s)' % (b.builder_name, b.build_n
umber) for b in builds)) |
169 _log.info(' %s: %s', test, builds_str) | 170 _log.info(' %s: %s', test, builds_str) |
OLD | NEW |