Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2009 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 """Client-side script to send a try job to the try server. It communicates to | 5 """Client-side script to send a try job to the try server. It communicates to |
| 6 the try server by either writting to a svn repository or by directly connecting | 6 the try server by either writting to a svn repository or by directly connecting |
| 7 to the server by HTTP. | 7 to the server by HTTP. |
| 8 """ | 8 """ |
| 9 | 9 |
| 10 import datetime | 10 import datetime |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 256 if options.email: | 256 if options.email: |
| 257 values['email'] = options.email | 257 values['email'] = options.email |
| 258 values['user'] = options.user | 258 values['user'] = options.user |
| 259 values['name'] = options.name | 259 values['name'] = options.name |
| 260 if options.bot: | 260 if options.bot: |
| 261 values['bot'] = ','.join(options.bot) | 261 values['bot'] = ','.join(options.bot) |
| 262 if options.revision: | 262 if options.revision: |
| 263 values['revision'] = options.revision | 263 values['revision'] = options.revision |
| 264 if options.clobber: | 264 if options.clobber: |
| 265 values['clobber'] = 'true' | 265 values['clobber'] = 'true' |
| 266 if options.tests: | 266 if options.testfilter: |
| 267 values['tests'] = ','.join(options.tests) | 267 values['testfilter'] = ','.join(options.testfilter) |
| 268 if options.root: | 268 if options.root: |
| 269 values['root'] = options.root | 269 values['root'] = options.root |
| 270 if options.patchlevel: | 270 if options.patchlevel: |
| 271 values['patchlevel'] = options.patchlevel | 271 values['patchlevel'] = options.patchlevel |
| 272 if options.issue: | 272 if options.issue: |
| 273 values['issue'] = options.issue | 273 values['issue'] = options.issue |
| 274 if options.patchset: | 274 if options.patchset: |
| 275 values['patchset'] = options.patchset | 275 values['patchset'] = options.patchset |
| 276 if options.target: | 276 if options.target: |
| 277 values['target'] = options.target | 277 values['target'] = options.target |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 489 help="Force a clobber before building; e.g. don't do an " | 489 help="Force a clobber before building; e.g. don't do an " |
| 490 "incremental build") | 490 "incremental build") |
| 491 # TODO(maruel): help="Select a specific configuration, usually 'debug' or " | 491 # TODO(maruel): help="Select a specific configuration, usually 'debug' or " |
| 492 # "'release'" | 492 # "'release'" |
| 493 group.add_option("--target", help=optparse.SUPPRESS_HELP) | 493 group.add_option("--target", help=optparse.SUPPRESS_HELP) |
| 494 | 494 |
| 495 group.add_option("--project", | 495 group.add_option("--project", |
| 496 help="Override which project to use. Projects are defined " | 496 help="Override which project to use. Projects are defined " |
| 497 "server-side to define what default bot set to use") | 497 "server-side to define what default bot set to use") |
| 498 | 498 |
| 499 # Override the list of tests to run, use multiple times to list many tests | 499 group.add_option("-t", "--testfilter", action="append", |
| 500 # (or comma separated) | 500 help="Add a gtest_filter to a test. Use multiple times to " |
| 501 group.add_option("-t", "--tests", action="append", | 501 "specify filters for different tests. (i.e. " |
| 502 help=optparse.SUPPRESS_HELP) | 502 "--testfilter base_unittests:ThreadTest.* " |
| 503 "--testfilter ui_tests) If you specify any testfilters " | |
| 504 "the test results will not be reported in rietveld and " | |
| 505 "only tests with filters will run.") | |
| 506 | |
| 503 parser.add_option_group(group) | 507 parser.add_option_group(group) |
| 504 | 508 |
| 505 group = optparse.OptionGroup(parser, "Patch to run") | 509 group = optparse.OptionGroup(parser, "Patch to run") |
| 506 group.add_option("-f", "--file", default=file_list, dest="files", | 510 group.add_option("-f", "--file", default=file_list, dest="files", |
| 507 metavar="FILE", action="append", | 511 metavar="FILE", action="append", |
| 508 help="Use many times to list the files to include in the " | 512 help="Use many times to list the files to include in the " |
| 509 "try, relative to the repository root") | 513 "try, relative to the repository root") |
| 510 group.add_option("--diff", | 514 group.add_option("--diff", |
| 511 help="File containing the diff to try") | 515 help="File containing the diff to try") |
| 512 group.add_option("--url", | 516 group.add_option("--url", |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 676 options.name = 'Issue %s' % options.issue | 680 options.name = 'Issue %s' % options.issue |
| 677 else: | 681 else: |
| 678 options.name = 'Unnamed' | 682 options.name = 'Unnamed' |
| 679 print('Note: use --name NAME to change the try job name.') | 683 print('Note: use --name NAME to change the try job name.') |
| 680 if not options.email: | 684 if not options.email: |
| 681 parser.error('Using an anonymous checkout. Please use --email or set ' | 685 parser.error('Using an anonymous checkout. Please use --email or set ' |
| 682 'the TRYBOT_RESULTS_EMAIL_ADDRESS environment variable.') | 686 'the TRYBOT_RESULTS_EMAIL_ADDRESS environment variable.') |
| 683 else: | 687 else: |
| 684 print('Results will be emailed to: ' + options.email) | 688 print('Results will be emailed to: ' + options.email) |
| 685 | 689 |
| 690 # Prevent reitveld updates if we aren't running all the tests. | |
|
M-A Ruel
2010/05/01 01:25:45
rietveld
| |
| 691 if options.testfilter is not None: | |
| 692 options.issue = None | |
| 693 options.patchset = None | |
| 694 | |
| 686 # Send the patch. | 695 # Send the patch. |
| 687 if options.send_patch: | 696 if options.send_patch: |
| 688 # If forced. | 697 # If forced. |
| 689 options.send_patch(options) | 698 options.send_patch(options) |
| 690 PrintSuccess(options) | 699 PrintSuccess(options) |
| 691 return 0 | 700 return 0 |
| 692 try: | 701 try: |
| 693 if can_http: | 702 if can_http: |
| 694 _SendChangeHTTP(options) | 703 _SendChangeHTTP(options) |
| 695 PrintSuccess(options) | 704 PrintSuccess(options) |
| 696 return 0 | 705 return 0 |
| 697 except NoTryServerAccess: | 706 except NoTryServerAccess: |
| 698 if not can_svn: | 707 if not can_svn: |
| 699 raise | 708 raise |
| 700 _SendChangeSVN(options) | 709 _SendChangeSVN(options) |
| 701 PrintSuccess(options) | 710 PrintSuccess(options) |
| 702 return 0 | 711 return 0 |
| 703 except (InvalidScript, NoTryServerAccess), e: | 712 except (InvalidScript, NoTryServerAccess), e: |
| 704 if swallow_exception: | 713 if swallow_exception: |
| 705 return 1 | 714 return 1 |
| 706 print e | 715 print e |
| 707 return 1 | 716 return 1 |
| 708 return 0 | 717 return 0 |
| 709 | 718 |
| 710 | 719 |
| 711 if __name__ == "__main__": | 720 if __name__ == "__main__": |
| 712 sys.exit(TryChange(None, [], False)) | 721 sys.exit(TryChange(None, [], False)) |
| OLD | NEW |