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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 def trigger_jobs_for_missing_builds(self, builds): | 98 def trigger_jobs_for_missing_builds(self, builds): |
99 builders_with_builds = {b.builder_name for b in builds} | 99 builders_with_builds = {b.builder_name for b in builds} |
100 builders_without_builds = set(self._try_bots()) - builders_with_builds | 100 builders_without_builds = set(self._try_bots()) - builders_with_builds |
101 if not builders_without_builds: | 101 if not builders_without_builds: |
102 return | 102 return |
103 | 103 |
104 _log.info('Triggering try jobs for:') | 104 _log.info('Triggering try jobs for:') |
105 for builder in sorted(builders_without_builds): | 105 for builder in sorted(builders_without_builds): |
106 _log.info(' %s', builder) | 106 _log.info(' %s', builder) |
107 | 107 |
108 git_cl = GitCL(self._tool.executive) | 108 # If the builders may be under different masters, then they cannot |
109 command = ['try'] | 109 # all be started in one invocation of git cl try without providing |
| 110 # master names. Doing separate invocations is slower, but always works |
| 111 # even when there are builders under different master names. |
110 for builder in sorted(builders_without_builds): | 112 for builder in sorted(builders_without_builds): |
111 command += ['-b', builder] | 113 self.git_cl().run(['try', '-b', builder]) |
112 self.git_cl().run(command) | |
113 | 114 |
114 def _test_prefix_list(self, issue_number, only_changed_tests): | 115 def _test_prefix_list(self, issue_number, only_changed_tests): |
115 """Returns a collection of test, builder and file extensions to get new
baselines for. | 116 """Returns a collection of test, builder and file extensions to get new
baselines for. |
116 | 117 |
117 Args: | 118 Args: |
118 issue_number: The CL number of the change which needs new baselines. | 119 issue_number: The CL number of the change which needs new baselines. |
119 only_changed_tests: Whether to only include baselines for tests that | 120 only_changed_tests: Whether to only include baselines for tests that |
120 are changed in this CL. If False, all new baselines for failing | 121 are changed in this CL. If False, all new baselines for failing |
121 tests will be downloaded, even for tests that were not modified. | 122 tests will be downloaded, even for tests that were not modified. |
122 | 123 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 @staticmethod | 169 @staticmethod |
169 def _log_test_prefix_list(test_prefix_list): | 170 def _log_test_prefix_list(test_prefix_list): |
170 """Logs the tests to download new baselines for.""" | 171 """Logs the tests to download new baselines for.""" |
171 if not test_prefix_list: | 172 if not test_prefix_list: |
172 _log.info('No tests to rebaseline; exiting.') | 173 _log.info('No tests to rebaseline; exiting.') |
173 return | 174 return |
174 _log.info('Tests to rebaseline:') | 175 _log.info('Tests to rebaseline:') |
175 for test, builds in test_prefix_list.iteritems(): | 176 for test, builds in test_prefix_list.iteritems(): |
176 builds_str = ', '.join(sorted('%s (%s)' % (b.builder_name, b.build_n
umber) for b in builds)) | 177 builds_str = ', '.join(sorted('%s (%s)' % (b.builder_name, b.build_n
umber) for b in builds)) |
177 _log.info(' %s: %s', test, builds_str) | 178 _log.info(' %s: %s', test, builds_str) |
OLD | NEW |