OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Run Performance Test Bisect Tool | 6 """Run Performance Test Bisect Tool |
7 | 7 |
8 This script is used by a trybot to run the src/tools/bisect-perf-regression.py | 8 This script is used by a trybot to run the src/tools/bisect-perf-regression.py |
9 script with the parameters specified in run-bisect-perf-regression.cfg. It will | 9 script with the parameters specified in run-bisect-perf-regression.cfg. It will |
10 check out a copy of the depot in a subdirectory 'bisect' of the working | 10 check out a copy of the depot in a subdirectory 'bisect' of the working |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 cmd.extend(['--target_platform', 'android-chrome']) | 386 cmd.extend(['--target_platform', 'android-chrome']) |
387 else: | 387 else: |
388 cmd.extend(['--target_platform', 'android']) | 388 cmd.extend(['--target_platform', 'android']) |
389 | 389 |
390 if path_to_goma: | 390 if path_to_goma: |
391 cmd.append('--use_goma') | 391 cmd.append('--use_goma') |
392 | 392 |
393 if path_to_extra_src: | 393 if path_to_extra_src: |
394 cmd.extend(['--extra_src', path_to_extra_src]) | 394 cmd.extend(['--extra_src', path_to_extra_src]) |
395 | 395 |
| 396 # These flags are used to download build archives from cloud storage if |
| 397 # available, otherwise will post a try_job_http request to build it on |
| 398 # tryserver. |
| 399 if config.get('gs_bucket'): |
| 400 if config.get('builder_host') and config.get('builder_port'): |
| 401 cmd.extend(['--gs_bucket', config['gs_bucket'], |
| 402 '--builder_host', config['builder_host'], |
| 403 '--builder_port', config['builder_port'] |
| 404 ]) |
| 405 else: |
| 406 print ('Error: Specified gs_bucket, but missing builder_host or ' |
| 407 'builder_port information in config.') |
| 408 return 1 |
| 409 |
| 410 cmd.extend(['-r', config['repeat_count']]) |
| 411 |
396 if dry_run: | 412 if dry_run: |
397 cmd.extend(['--debug_ignore_build', '--debug_ignore_sync', | 413 cmd.extend(['--debug_ignore_build', '--debug_ignore_sync', |
398 '--debug_ignore_perf_test']) | 414 '--debug_ignore_perf_test']) |
399 cmd = [str(c) for c in cmd] | 415 cmd = [str(c) for c in cmd] |
400 | 416 |
401 with Goma(path_to_goma) as goma: | 417 with Goma(path_to_goma) as goma: |
402 return_code = subprocess.call(cmd) | 418 return_code = subprocess.call(cmd) |
403 | 419 |
404 if return_code: | 420 if return_code: |
405 print 'Error: bisect-perf-regression.py returned with error %d' %\ | 421 print 'Error: bisect-perf-regression.py returned with error %d' %\ |
(...skipping 30 matching lines...) Expand all Loading... |
436 help='Path to extra source file. If this is supplied, ' | 452 help='Path to extra source file. If this is supplied, ' |
437 'bisect script will use this to override default behavior.') | 453 'bisect script will use this to override default behavior.') |
438 parser.add_option('--dry_run', | 454 parser.add_option('--dry_run', |
439 action="store_true", | 455 action="store_true", |
440 help='The script will perform the full bisect, but ' | 456 help='The script will perform the full bisect, but ' |
441 'without syncing, building, or running the performance ' | 457 'without syncing, building, or running the performance ' |
442 'tests.') | 458 'tests.') |
443 (opts, args) = parser.parse_args() | 459 (opts, args) = parser.parse_args() |
444 | 460 |
445 path_to_current_directory = os.path.abspath(os.path.dirname(sys.argv[0])) | 461 path_to_current_directory = os.path.abspath(os.path.dirname(sys.argv[0])) |
446 | 462 import pdb; pdb.set_trace() |
447 # If they've specified their own config file, use that instead. | 463 # If they've specified their own config file, use that instead. |
448 if opts.path_to_config: | 464 if opts.path_to_config: |
449 path_to_bisect_cfg = opts.path_to_config | 465 path_to_bisect_cfg = opts.path_to_config |
450 else: | 466 else: |
451 path_to_bisect_cfg = os.path.join(path_to_current_directory, | 467 path_to_bisect_cfg = os.path.join(path_to_current_directory, |
452 'run-bisect-perf-regression.cfg') | 468 'run-bisect-perf-regression.cfg') |
453 | 469 |
454 config = _LoadConfigFile(path_to_bisect_cfg) | 470 config = _LoadConfigFile(path_to_bisect_cfg) |
455 | 471 |
456 # Check if the config is valid. | 472 # Check if the config is valid. |
(...skipping 29 matching lines...) Expand all Loading... |
486 opts.path_to_goma) | 502 opts.path_to_goma) |
487 | 503 |
488 print 'Error: Could not load config file. Double check your changes to '\ | 504 print 'Error: Could not load config file. Double check your changes to '\ |
489 'run-bisect-perf-regression.cfg/run-perf-test.cfg for syntax errors.' | 505 'run-bisect-perf-regression.cfg/run-perf-test.cfg for syntax errors.' |
490 print | 506 print |
491 return 1 | 507 return 1 |
492 | 508 |
493 | 509 |
494 if __name__ == '__main__': | 510 if __name__ == '__main__': |
495 sys.exit(main()) | 511 sys.exit(main()) |
OLD | NEW |