| 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 | 293 |
| 294 Args: | 294 Args: |
| 295 bot_platform: Name of the platform to be generated. | 295 bot_platform: Name of the platform to be generated. |
| 296 | 296 |
| 297 Returns: | 297 Returns: |
| 298 A dictionary with perf config parameters. | 298 A dictionary with perf config parameters. |
| 299 """ | 299 """ |
| 300 # To make sure that we don't mutate the original args | 300 # To make sure that we don't mutate the original args |
| 301 arguments = arguments[:] | 301 arguments = arguments[:] |
| 302 | 302 |
| 303 # Always set verbose logging for later debugging |
| 304 if '-v' not in arguments and '--verbose' not in arguments: |
| 305 arguments.append('--verbose') |
| 306 |
| 303 # Generate the command line for the perf trybots | 307 # Generate the command line for the perf trybots |
| 304 target_arch = 'ia32' | 308 target_arch = 'ia32' |
| 305 if any(arg == '--chrome-root' or arg.startswith('--chrome-root=') for arg | 309 if any(arg == '--chrome-root' or arg.startswith('--chrome-root=') for arg |
| 306 in arguments): | 310 in arguments): |
| 307 raise ValueError( | 311 raise ValueError( |
| 308 'Trybot does not suport --chrome-root option set directly ' | 312 'Trybot does not suport --chrome-root option set directly ' |
| 309 'through command line since it may contain references to your local ' | 313 'through command line since it may contain references to your local ' |
| 310 'directory') | 314 'directory') |
| 311 if bot_platform in ['win', 'win-x64']: | 315 if bot_platform in ['win', 'win-x64']: |
| 312 arguments.insert(0, 'python tools\\perf\\run_benchmark') | 316 arguments.insert(0, 'python tools\\perf\\run_benchmark') |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 return ERROR # pylint: disable=lost-exception | 425 return ERROR # pylint: disable=lost-exception |
| 422 logging.info('Checked out original branch: %s', original_branchname) | 426 logging.info('Checked out original branch: %s', original_branchname) |
| 423 returncode, out, err = _RunProcess( | 427 returncode, out, err = _RunProcess( |
| 424 ['git', 'branch', '-D', 'telemetry-tryjob']) | 428 ['git', 'branch', '-D', 'telemetry-tryjob']) |
| 425 if returncode: | 429 if returncode: |
| 426 logging.error('Could not delete telemetry-tryjob branch. ' | 430 logging.error('Could not delete telemetry-tryjob branch. ' |
| 427 'Please delete it manually: %s', err) | 431 'Please delete it manually: %s', err) |
| 428 return ERROR # pylint: disable=lost-exception | 432 return ERROR # pylint: disable=lost-exception |
| 429 logging.info('Deleted temp branch: telemetry-tryjob') | 433 logging.info('Deleted temp branch: telemetry-tryjob') |
| 430 return SUCCESS | 434 return SUCCESS |
| OLD | NEW |