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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 # TODO(qyearsley): Fix places where non-existing tests may be added: | 77 # TODO(qyearsley): Fix places where non-existing tests may be added: |
78 # 1. Make sure that the tests obtained when passing --only-changed-test
s include only existing tests. | 78 # 1. Make sure that the tests obtained when passing --only-changed-test
s include only existing tests. |
79 # 2. Make sure that update-w3c-test-expectations doesn't specify non-ex
isting tests (http://crbug.com/649691). | 79 # 2. Make sure that update-w3c-test-expectations doesn't specify non-ex
isting tests (http://crbug.com/649691). |
80 test_prefix_list = self._filter_existing(test_prefix_list) | 80 test_prefix_list = self._filter_existing(test_prefix_list) |
81 | 81 |
82 self._log_test_prefix_list(test_prefix_list) | 82 self._log_test_prefix_list(test_prefix_list) |
83 | 83 |
84 if options.dry_run: | 84 if options.dry_run: |
85 return | 85 return |
| 86 # NOTE(qyearsley): If this is changed to stage all new files with git, |
| 87 # e.g. if update_scm is not False, then update_w3c_test_expectations.py |
| 88 # should be changed to not call git add --all. |
86 self.rebaseline(options, test_prefix_list, update_scm=False) | 89 self.rebaseline(options, test_prefix_list, update_scm=False) |
87 | 90 |
88 def _filter_existing(self, test_prefix_list): | 91 def _filter_existing(self, test_prefix_list): |
89 """Filters out entries in |test_prefix_list| for tests that don't exist.
""" | 92 """Filters out entries in |test_prefix_list| for tests that don't exist.
""" |
90 new_test_prefix_list = {} | 93 new_test_prefix_list = {} |
91 port = self._tool.port_factory.get() | 94 port = self._tool.port_factory.get() |
92 for test in test_prefix_list: | 95 for test in test_prefix_list: |
93 path = port.abspath_for_test(test) | 96 path = port.abspath_for_test(test) |
94 if self._tool.filesystem.exists(path): | 97 if self._tool.filesystem.exists(path): |
95 new_test_prefix_list[test] = test_prefix_list[test] | 98 new_test_prefix_list[test] = test_prefix_list[test] |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 @staticmethod | 191 @staticmethod |
189 def _log_test_prefix_list(test_prefix_list): | 192 def _log_test_prefix_list(test_prefix_list): |
190 """Logs the tests to download new baselines for.""" | 193 """Logs the tests to download new baselines for.""" |
191 if not test_prefix_list: | 194 if not test_prefix_list: |
192 _log.info('No tests to rebaseline; exiting.') | 195 _log.info('No tests to rebaseline; exiting.') |
193 return | 196 return |
194 _log.info('Tests to rebaseline:') | 197 _log.info('Tests to rebaseline:') |
195 for test, builds in test_prefix_list.iteritems(): | 198 for test, builds in test_prefix_list.iteritems(): |
196 builds_str = ', '.join(sorted('%s (%s)' % (b.builder_name, b.build_n
umber) for b in builds)) | 199 builds_str = ', '.join(sorted('%s (%s)' % (b.builder_name, b.build_n
umber) for b in builds)) |
197 _log.info(' %s: %s', test, builds_str) | 200 _log.info(' %s: %s', test, builds_str) |
OLD | NEW |