Chromium Code Reviews| 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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 362 parser = optparse.OptionParser(usage=usage) | 362 parser = optparse.OptionParser(usage=usage) |
| 363 parser.add_option('-w', '--working_directory', | 363 parser.add_option('-w', '--working_directory', |
| 364 type='str', | 364 type='str', |
| 365 help='A working directory to supply to the bisection ' | 365 help='A working directory to supply to the bisection ' |
| 366 'script, which will use it as the location to checkout ' | 366 'script, which will use it as the location to checkout ' |
| 367 'a copy of the chromium depot.') | 367 'a copy of the chromium depot.') |
| 368 parser.add_option('-p', '--path_to_goma', | 368 parser.add_option('-p', '--path_to_goma', |
| 369 type='str', | 369 type='str', |
| 370 help='Path to goma directory. If this is supplied, goma ' | 370 help='Path to goma directory. If this is supplied, goma ' |
| 371 'builds will be enabled.') | 371 'builds will be enabled.') |
| 372 parser.add_option('--path_to_config', | |
| 373 type='str', | |
| 374 help='Path to the config file to use. If this is supplied, ' | |
| 375 'the bisect script will use this to override the default ' | |
| 376 'config file path.') | |
| 372 parser.add_option('--extra_src', | 377 parser.add_option('--extra_src', |
| 373 type='str', | 378 type='str', |
| 374 help='Path to extra source file. If this is supplied, ' | 379 help='Path to extra source file. If this is supplied, ' |
| 375 'bisect script will use this to override default behavior.') | 380 'bisect script will use this to override default behavior.') |
| 376 parser.add_option('--dry_run', | 381 parser.add_option('--dry_run', |
| 377 action="store_true", | 382 action="store_true", |
| 378 help='The script will perform the full bisect, but ' | 383 help='The script will perform the full bisect, but ' |
| 379 'without syncing, building, or running the performance ' | 384 'without syncing, building, or running the performance ' |
| 380 'tests.') | 385 'tests.') |
| 381 (opts, args) = parser.parse_args() | 386 (opts, args) = parser.parse_args() |
| 382 | 387 |
| 383 path_to_current_directory = os.path.abspath(os.path.dirname(sys.argv[0])) | 388 path_to_current_directory = os.path.abspath(os.path.dirname(sys.argv[0])) |
| 384 path_to_bisect_cfg = os.path.join(path_to_current_directory, | 389 |
| 385 'run-bisect-perf-regression.cfg') | 390 # If they've specified their own config file, use that instead. |
| 391 if opts.path_to_config: | |
| 392 path_to_bisect_cfg = opts.path_to_config | |
|
prasadv
2014/04/09 23:17:51
Should'n we validate whether the path_to_config is
shatch
2014/04/10 17:32:54
Done.
| |
| 393 else: | |
| 394 path_to_bisect_cfg = os.path.join(path_to_current_directory, | |
| 395 'run-bisect-perf-regression.cfg') | |
| 386 | 396 |
| 387 config = _LoadConfigFile(path_to_bisect_cfg) | 397 config = _LoadConfigFile(path_to_bisect_cfg) |
| 388 | 398 |
| 389 # Check if the config is empty | 399 # Check if the config is empty |
| 390 config_has_values = [v for v in config.values() if v] | 400 config_has_values = [v for v in config.values() if v] |
| 391 | 401 |
| 392 if config and config_has_values: | 402 if config and config_has_values: |
| 393 if not opts.working_directory: | 403 if not opts.working_directory: |
| 394 print 'Error: missing required parameter: --working_directory' | 404 print 'Error: missing required parameter: --working_directory' |
| 395 print | 405 print |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 415 opts.path_to_goma) | 425 opts.path_to_goma) |
| 416 | 426 |
| 417 print 'Error: Could not load config file. Double check your changes to '\ | 427 print 'Error: Could not load config file. Double check your changes to '\ |
| 418 'run-bisect-perf-regression.cfg/run-perf-test.cfg for syntax errors.' | 428 'run-bisect-perf-regression.cfg/run-perf-test.cfg for syntax errors.' |
| 419 print | 429 print |
| 420 return 1 | 430 return 1 |
| 421 | 431 |
| 422 | 432 |
| 423 if __name__ == '__main__': | 433 if __name__ == '__main__': |
| 424 sys.exit(main()) | 434 sys.exit(main()) |
| OLD | NEW |