| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 ''' | 3 ''' |
| 4 Copyright 2012 Google Inc. | 4 Copyright 2012 Google Inc. |
| 5 | 5 |
| 6 Use of this source code is governed by a BSD-style license that can be | 6 Use of this source code is governed by a BSD-style license that can be |
| 7 found in the LICENSE file. | 7 found in the LICENSE file. |
| 8 ''' | 8 ''' |
| 9 | 9 |
| 10 ''' | 10 ''' |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 'pertain to this set of rebaselines.')) | 371 'pertain to this set of rebaselines.')) |
| 372 parser.add_argument('--builders', metavar='BUILDER', nargs='+', | 372 parser.add_argument('--builders', metavar='BUILDER', nargs='+', |
| 373 help=('which platforms to rebaseline; ' | 373 help=('which platforms to rebaseline; ' |
| 374 'if unspecified, rebaseline all known platforms ' | 374 'if unspecified, rebaseline all known platforms ' |
| 375 '(see below for a list)')) | 375 '(see below for a list)')) |
| 376 # TODO(epoger): Add test that exercises --configs argument. | 376 # TODO(epoger): Add test that exercises --configs argument. |
| 377 parser.add_argument('--configs', metavar='CONFIG', nargs='+', | 377 parser.add_argument('--configs', metavar='CONFIG', nargs='+', |
| 378 help=('which configurations to rebaseline, e.g. ' | 378 help=('which configurations to rebaseline, e.g. ' |
| 379 '"--configs 565 8888", as a filter over the full set ' | 379 '"--configs 565 8888", as a filter over the full set ' |
| 380 'of results in ACTUALS_FILENAME; if unspecified, ' | 380 'of results in ACTUALS_FILENAME; if unspecified, ' |
| 381 'rebaseline *all* configs that are available. ' | 381 'rebaseline *all* configs that are available.')) |
| 382 'Ignored if SKIMAGE is True.')) | |
| 383 parser.add_argument('--expectations-filename', | 382 parser.add_argument('--expectations-filename', |
| 384 help=('filename (under EXPECTATIONS_ROOT) to read ' | 383 help=('filename (under EXPECTATIONS_ROOT) to read ' |
| 385 'current expectations from, and to write new ' | 384 'current expectations from, and to write new ' |
| 386 'expectations into (unless a separate ' | 385 'expectations into (unless a separate ' |
| 387 'EXPECTATIONS_FILENAME_OUTPUT has been specified); ' | 386 'EXPECTATIONS_FILENAME_OUTPUT has been specified); ' |
| 388 'defaults to %(default)s'), | 387 'defaults to %(default)s'), |
| 389 default='expected-results.json') | 388 default='expected-results.json') |
| 390 parser.add_argument('--expectations-filename-output', | 389 parser.add_argument('--expectations-filename-output', |
| 391 help=('filename (under EXPECTATIONS_ROOT) to write ' | 390 help=('filename (under EXPECTATIONS_ROOT) to write ' |
| 392 'updated expectations into; by default, overwrites ' | 391 'updated expectations into; by default, overwrites ' |
| (...skipping 12 matching lines...) Expand all Loading... |
| 405 'at the end')) | 404 'at the end')) |
| 406 parser.add_argument('--notes', | 405 parser.add_argument('--notes', |
| 407 help=('free-form text notes to add to all updated ' | 406 help=('free-form text notes to add to all updated ' |
| 408 'expectations')) | 407 'expectations')) |
| 409 # TODO(epoger): Add test that exercises --tests argument. | 408 # TODO(epoger): Add test that exercises --tests argument. |
| 410 parser.add_argument('--tests', metavar='TEST', nargs='+', | 409 parser.add_argument('--tests', metavar='TEST', nargs='+', |
| 411 help=('which tests to rebaseline, e.g. ' | 410 help=('which tests to rebaseline, e.g. ' |
| 412 '"--tests aaclip bigmatrix", as a filter over the ' | 411 '"--tests aaclip bigmatrix", as a filter over the ' |
| 413 'full set of results in ACTUALS_FILENAME; if ' | 412 'full set of results in ACTUALS_FILENAME; if ' |
| 414 'unspecified, rebaseline *all* tests that are ' | 413 'unspecified, rebaseline *all* tests that are ' |
| 415 'available. Ignored if SKIMAGE is True.')) | 414 'available.')) |
| 416 parser.add_argument('--unreviewed', action='store_true', | 415 parser.add_argument('--unreviewed', action='store_true', |
| 417 help=('mark all expectations modified by this run as ' | 416 help=('mark all expectations modified by this run as ' |
| 418 '"%s": False' % | 417 '"%s": False' % |
| 419 gm_json.JSONKEY_EXPECTEDRESULTS_REVIEWED)) | 418 gm_json.JSONKEY_EXPECTEDRESULTS_REVIEWED)) |
| 420 parser.add_argument('--ignore-failure', action='store_true', | 419 parser.add_argument('--ignore-failure', action='store_true', |
| 421 help=('mark all expectations modified by this run as ' | 420 help=('mark all expectations modified by this run as ' |
| 422 '"%s": True' % | 421 '"%s": True' % |
| 423 gm_json.JSONKEY_ACTUALRESULTS_FAILUREIGNORED)) | 422 gm_json.JSONKEY_ACTUALRESULTS_FAILUREIGNORED)) |
| 424 parser.add_argument('--from-trybot', action='store_true', | 423 parser.add_argument('--from-trybot', action='store_true', |
| 425 help=('pull the actual-results.json file from the ' | 424 help=('pull the actual-results.json file from the ' |
| (...skipping 11 matching lines...) Expand all Loading... |
| 437 missing_json_is_fatal = True | 436 missing_json_is_fatal = True |
| 438 else: | 437 else: |
| 439 builders = sorted(TEST_BUILDERS) | 438 builders = sorted(TEST_BUILDERS) |
| 440 missing_json_is_fatal = False | 439 missing_json_is_fatal = False |
| 441 if args.skimage: | 440 if args.skimage: |
| 442 # Use a different default if --skimage is specified. | 441 # Use a different default if --skimage is specified. |
| 443 if args.actuals_base_url == parser.get_default('actuals_base_url'): | 442 if args.actuals_base_url == parser.get_default('actuals_base_url'): |
| 444 args.actuals_base_url = gm_json.SKIMAGE_ACTUALS_BASE_URL | 443 args.actuals_base_url = gm_json.SKIMAGE_ACTUALS_BASE_URL |
| 445 if args.expectations_root == parser.get_default('expectations_root'): | 444 if args.expectations_root == parser.get_default('expectations_root'): |
| 446 args.expectations_root = gm_json.SKIMAGE_EXPECTATIONS_ROOT | 445 args.expectations_root = gm_json.SKIMAGE_EXPECTATIONS_ROOT |
| 447 # Also ignore TESTS and CONFIGS | |
| 448 args.tests = None | |
| 449 args.configs = None | |
| 450 for builder in builders: | 446 for builder in builders: |
| 451 if not builder in TEST_BUILDERS: | 447 if not builder in TEST_BUILDERS: |
| 452 raise Exception(('unrecognized builder "%s"; ' + | 448 raise Exception(('unrecognized builder "%s"; ' + |
| 453 'should be one of %s') % ( | 449 'should be one of %s') % ( |
| 454 builder, TEST_BUILDERS)) | 450 builder, TEST_BUILDERS)) |
| 455 | 451 |
| 456 expectations_json_file = os.path.join(args.expectations_root, builder, | 452 expectations_json_file = os.path.join(args.expectations_root, builder, |
| 457 args.expectations_filename) | 453 args.expectations_filename) |
| 458 if os.path.isfile(expectations_json_file): | 454 if os.path.isfile(expectations_json_file): |
| 459 rebaseliner = JsonRebaseliner( | 455 rebaseliner = JsonRebaseliner( |
| (...skipping 14 matching lines...) Expand all Loading... |
| 474 except: | 470 except: |
| 475 exception_handler.RaiseExceptionOrContinue() | 471 exception_handler.RaiseExceptionOrContinue() |
| 476 else: | 472 else: |
| 477 try: | 473 try: |
| 478 raise _InternalException('expectations_json_file %s not found' % | 474 raise _InternalException('expectations_json_file %s not found' % |
| 479 expectations_json_file) | 475 expectations_json_file) |
| 480 except: | 476 except: |
| 481 exception_handler.RaiseExceptionOrContinue() | 477 exception_handler.RaiseExceptionOrContinue() |
| 482 | 478 |
| 483 exception_handler.ReportAllFailures() | 479 exception_handler.ReportAllFailures() |
| OLD | NEW |