| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 import argparse | 5 import argparse |
| 6 import os | 6 import os |
| 7 import logging | 7 import logging |
| 8 import re | 8 import re |
| 9 import subprocess | 9 import subprocess |
| 10 import urllib2 | 10 import urllib2 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 137 |
| 138 @classmethod | 138 @classmethod |
| 139 def AddCommandLineArgs(cls, parser, environment): | 139 def AddCommandLineArgs(cls, parser, environment): |
| 140 del environment # unused | 140 del environment # unused |
| 141 available_bots = _GetTrybotList(cls._GetBuilderList()) | 141 available_bots = _GetTrybotList(cls._GetBuilderList()) |
| 142 parser.add_argument('benchmark_name', type=str) | 142 parser.add_argument('benchmark_name', type=str) |
| 143 parser.add_argument( | 143 parser.add_argument( |
| 144 '--trybot', choices=available_bots, | 144 '--trybot', choices=available_bots, |
| 145 help=('specify which bots to run telemetry benchmarks on. ' | 145 help=('specify which bots to run telemetry benchmarks on. ' |
| 146 ' Allowed values are:\n'+'\n'.join(available_bots)), | 146 ' Allowed values are:\n'+'\n'.join(available_bots)), |
| 147 metavar='') | 147 metavar='', required=True) |
| 148 | 148 |
| 149 def Run(self, options, extra_args=None): | 149 def Run(self, options, extra_args=None): |
| 150 """Sends a tryjob to a perf trybot. | 150 """Sends a tryjob to a perf trybot. |
| 151 | 151 |
| 152 This creates a branch, telemetry-tryjob, switches to that branch, edits | 152 This creates a branch, telemetry-tryjob, switches to that branch, edits |
| 153 the bisect config, commits it, uploads the CL to rietveld, and runs a | 153 the bisect config, commits it, uploads the CL to rietveld, and runs a |
| 154 tryjob on the given bot. | 154 tryjob on the given bot. |
| 155 """ | 155 """ |
| 156 if extra_args is None: | 156 if extra_args is None: |
| 157 extra_args = [] | 157 extra_args = [] |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 logging.info('Checked out original branch: %s', original_branchname) | 353 logging.info('Checked out original branch: %s', original_branchname) |
| 354 returncode, out, err = _RunProcess( | 354 returncode, out, err = _RunProcess( |
| 355 ['git', 'branch', '-D', 'telemetry-tryjob']) | 355 ['git', 'branch', '-D', 'telemetry-tryjob']) |
| 356 if returncode: | 356 if returncode: |
| 357 logging.error('Could not delete telemetry-tryjob branch. ' | 357 logging.error('Could not delete telemetry-tryjob branch. ' |
| 358 'Please delete it manually: %s', err) | 358 'Please delete it manually: %s', err) |
| 359 return ERROR # pylint: disable=lost-exception | 359 return ERROR # pylint: disable=lost-exception |
| 360 logging.info('Deleted temp branch: telemetry-tryjob') | 360 logging.info('Deleted temp branch: telemetry-tryjob') |
| 361 return SUCCESS | 361 return SUCCESS |
| 362 | 362 |
| OLD | NEW |