| 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 |
| 11 from webkitpy.common.net.git_cl import GitCL | 11 from webkitpy.common.net.git_cl import GitCL |
| 12 from webkitpy.layout_tests.models.test_expectations import BASELINE_SUFFIX_LIST | 12 from webkitpy.layout_tests.models.test_expectations import BASELINE_SUFFIX_LIST |
| 13 from webkitpy.tool.commands.rebaseline import AbstractParallelRebaselineCommand | 13 from webkitpy.tool.commands.rebaseline import AbstractParallelRebaselineCommand |
| 14 from webkitpy.w3c.wpt_manifest import WPTManifest |
| 14 | 15 |
| 15 _log = logging.getLogger(__name__) | 16 _log = logging.getLogger(__name__) |
| 16 | 17 |
| 17 | 18 |
| 18 class RebaselineCL(AbstractParallelRebaselineCommand): | 19 class RebaselineCL(AbstractParallelRebaselineCommand): |
| 19 name = "rebaseline-cl" | 20 name = "rebaseline-cl" |
| 20 help_text = "Fetches new baselines for a CL from test runs on try bots." | 21 help_text = "Fetches new baselines for a CL from test runs on try bots." |
| 21 long_help = ("By default, this command will check the latest try job results
" | 22 long_help = ("By default, this command will check the latest try job results
" |
| 22 "for all platforms, and start try jobs for platforms with no " | 23 "for all platforms, and start try jobs for platforms with no " |
| 23 "try jobs. Then, new baselines are downloaded for any tests " | 24 "try jobs. Then, new baselines are downloaded for any tests " |
| (...skipping 12 matching lines...) Expand all Loading... |
| 36 optparse.make_option( | 37 optparse.make_option( |
| 37 '--no-trigger-jobs', dest='trigger_jobs', action='store_false',
default=True, | 38 '--no-trigger-jobs', dest='trigger_jobs', action='store_false',
default=True, |
| 38 help='Do not trigger any try jobs.'), | 39 help='Do not trigger any try jobs.'), |
| 39 self.no_optimize_option, | 40 self.no_optimize_option, |
| 40 self.results_directory_option, | 41 self.results_directory_option, |
| 41 ]) | 42 ]) |
| 42 | 43 |
| 43 def execute(self, options, args, tool): | 44 def execute(self, options, args, tool): |
| 44 self._tool = tool | 45 self._tool = tool |
| 45 | 46 |
| 47 # TODO(qyearsley): Move this call to somewhere else. |
| 48 WPTManifest.ensure_manifest(tool) |
| 49 |
| 46 unstaged_baselines = self.unstaged_baselines() | 50 unstaged_baselines = self.unstaged_baselines() |
| 47 if unstaged_baselines: | 51 if unstaged_baselines: |
| 48 _log.error('Aborting: there are unstaged baselines:') | 52 _log.error('Aborting: there are unstaged baselines:') |
| 49 for path in unstaged_baselines: | 53 for path in unstaged_baselines: |
| 50 _log.error(' %s', path) | 54 _log.error(' %s', path) |
| 51 return 1 | 55 return 1 |
| 52 | 56 |
| 53 issue_number = self._get_issue_number() | 57 issue_number = self._get_issue_number() |
| 54 if not issue_number: | 58 if not issue_number: |
| 55 return 1 | 59 return 1 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 def _log_test_prefix_list(test_prefix_list): | 225 def _log_test_prefix_list(test_prefix_list): |
| 222 """Logs the tests to download new baselines for.""" | 226 """Logs the tests to download new baselines for.""" |
| 223 if not test_prefix_list: | 227 if not test_prefix_list: |
| 224 _log.info('No tests to rebaseline; exiting.') | 228 _log.info('No tests to rebaseline; exiting.') |
| 225 return | 229 return |
| 226 _log.debug('Tests to rebaseline:') | 230 _log.debug('Tests to rebaseline:') |
| 227 for test, builds in test_prefix_list.iteritems(): | 231 for test, builds in test_prefix_list.iteritems(): |
| 228 _log.debug(' %s:', test) | 232 _log.debug(' %s:', test) |
| 229 for build in sorted(builds): | 233 for build in sorted(builds): |
| 230 _log.debug(' %s', build) | 234 _log.debug(' %s', build) |
| OLD | NEW |