| 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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 'pertain to this set of rebaselines.')) | 381 'pertain to this set of rebaselines.')) |
| 382 parser.add_argument('--builders', metavar='BUILDER', nargs='+', | 382 parser.add_argument('--builders', metavar='BUILDER', nargs='+', |
| 383 help=('which platforms to rebaseline; ' | 383 help=('which platforms to rebaseline; ' |
| 384 'if unspecified, rebaseline all known platforms ' | 384 'if unspecified, rebaseline all known platforms ' |
| 385 '(see below for a list)')) | 385 '(see below for a list)')) |
| 386 # TODO(epoger): Add test that exercises --configs argument. | 386 # TODO(epoger): Add test that exercises --configs argument. |
| 387 parser.add_argument('--configs', metavar='CONFIG', nargs='+', | 387 parser.add_argument('--configs', metavar='CONFIG', nargs='+', |
| 388 help=('which configurations to rebaseline, e.g. ' | 388 help=('which configurations to rebaseline, e.g. ' |
| 389 '"--configs 565 8888", as a filter over the full set ' | 389 '"--configs 565 8888", as a filter over the full set ' |
| 390 'of results in ACTUALS_FILENAME; if unspecified, ' | 390 'of results in ACTUALS_FILENAME; if unspecified, ' |
| 391 'rebaseline *all* configs that are available. ' | 391 'rebaseline *all* configs that are available.')) |
| 392 'Ignored if SKIMAGE is True.')) | |
| 393 parser.add_argument('--expectations-filename', | 392 parser.add_argument('--expectations-filename', |
| 394 help=('filename (under EXPECTATIONS_ROOT) to read ' | 393 help=('filename (under EXPECTATIONS_ROOT) to read ' |
| 395 'current expectations from, and to write new ' | 394 'current expectations from, and to write new ' |
| 396 'expectations into (unless a separate ' | 395 'expectations into (unless a separate ' |
| 397 'EXPECTATIONS_FILENAME_OUTPUT has been specified); ' | 396 'EXPECTATIONS_FILENAME_OUTPUT has been specified); ' |
| 398 'defaults to %(default)s'), | 397 'defaults to %(default)s'), |
| 399 default='expected-results.json') | 398 default='expected-results.json') |
| 400 parser.add_argument('--expectations-filename-output', | 399 parser.add_argument('--expectations-filename-output', |
| 401 help=('filename (under EXPECTATIONS_ROOT) to write ' | 400 help=('filename (under EXPECTATIONS_ROOT) to write ' |
| 402 'updated expectations into; by default, overwrites ' | 401 'updated expectations into; by default, overwrites ' |
| (...skipping 12 matching lines...) Expand all Loading... |
| 415 'at the end')) | 414 'at the end')) |
| 416 parser.add_argument('--notes', | 415 parser.add_argument('--notes', |
| 417 help=('free-form text notes to add to all updated ' | 416 help=('free-form text notes to add to all updated ' |
| 418 'expectations')) | 417 'expectations')) |
| 419 # TODO(epoger): Add test that exercises --tests argument. | 418 # TODO(epoger): Add test that exercises --tests argument. |
| 420 parser.add_argument('--tests', metavar='TEST', nargs='+', | 419 parser.add_argument('--tests', metavar='TEST', nargs='+', |
| 421 help=('which tests to rebaseline, e.g. ' | 420 help=('which tests to rebaseline, e.g. ' |
| 422 '"--tests aaclip bigmatrix", as a filter over the ' | 421 '"--tests aaclip bigmatrix", as a filter over the ' |
| 423 'full set of results in ACTUALS_FILENAME; if ' | 422 'full set of results in ACTUALS_FILENAME; if ' |
| 424 'unspecified, rebaseline *all* tests that are ' | 423 'unspecified, rebaseline *all* tests that are ' |
| 425 'available. Ignored if SKIMAGE is True.')) | 424 'available.')) |
| 426 parser.add_argument('--unreviewed', action='store_true', | 425 parser.add_argument('--unreviewed', action='store_true', |
| 427 help=('mark all expectations modified by this run as ' | 426 help=('mark all expectations modified by this run as ' |
| 428 '"%s": False' % | 427 '"%s": False' % |
| 429 gm_json.JSONKEY_EXPECTEDRESULTS_REVIEWED)) | 428 gm_json.JSONKEY_EXPECTEDRESULTS_REVIEWED)) |
| 430 parser.add_argument('--ignore-failure', action='store_true', | 429 parser.add_argument('--ignore-failure', action='store_true', |
| 431 help=('mark all expectations modified by this run as ' | 430 help=('mark all expectations modified by this run as ' |
| 432 '"%s": True' % | 431 '"%s": True' % |
| 433 gm_json.JSONKEY_ACTUALRESULTS_FAILUREIGNORED)) | 432 gm_json.JSONKEY_ACTUALRESULTS_FAILUREIGNORED)) |
| 434 parser.add_argument('--from-trybot', action='store_true', | 433 parser.add_argument('--from-trybot', action='store_true', |
| 435 help=('pull the actual-results.json file from the ' | 434 help=('pull the actual-results.json file from the ' |
| (...skipping 11 matching lines...) Expand all Loading... |
| 447 missing_json_is_fatal = True | 446 missing_json_is_fatal = True |
| 448 else: | 447 else: |
| 449 builders = sorted(TEST_BUILDERS) | 448 builders = sorted(TEST_BUILDERS) |
| 450 missing_json_is_fatal = False | 449 missing_json_is_fatal = False |
| 451 if args.skimage: | 450 if args.skimage: |
| 452 # Use a different default if --skimage is specified. | 451 # Use a different default if --skimage is specified. |
| 453 if args.actuals_base_url == parser.get_default('actuals_base_url'): | 452 if args.actuals_base_url == parser.get_default('actuals_base_url'): |
| 454 args.actuals_base_url = gm_json.SKIMAGE_ACTUALS_BASE_URL | 453 args.actuals_base_url = gm_json.SKIMAGE_ACTUALS_BASE_URL |
| 455 if args.expectations_root == parser.get_default('expectations_root'): | 454 if args.expectations_root == parser.get_default('expectations_root'): |
| 456 args.expectations_root = gm_json.SKIMAGE_EXPECTATIONS_ROOT | 455 args.expectations_root = gm_json.SKIMAGE_EXPECTATIONS_ROOT |
| 457 # Also ignore TESTS and CONFIGS | |
| 458 args.tests = None | |
| 459 args.configs = None | |
| 460 for builder in builders: | 456 for builder in builders: |
| 461 if not builder in TEST_BUILDERS: | 457 if not builder in TEST_BUILDERS: |
| 462 raise Exception(('unrecognized builder "%s"; ' + | 458 raise Exception(('unrecognized builder "%s"; ' + |
| 463 'should be one of %s') % ( | 459 'should be one of %s') % ( |
| 464 builder, TEST_BUILDERS)) | 460 builder, TEST_BUILDERS)) |
| 465 | 461 |
| 466 expectations_json_file = os.path.join(args.expectations_root, builder, | 462 expectations_json_file = os.path.join(args.expectations_root, builder, |
| 467 args.expectations_filename) | 463 args.expectations_filename) |
| 468 if os.path.isfile(expectations_json_file): | 464 if os.path.isfile(expectations_json_file): |
| 469 rebaseliner = JsonRebaseliner( | 465 rebaseliner = JsonRebaseliner( |
| (...skipping 15 matching lines...) Expand all Loading... |
| 485 except: | 481 except: |
| 486 exception_handler.RaiseExceptionOrContinue() | 482 exception_handler.RaiseExceptionOrContinue() |
| 487 else: | 483 else: |
| 488 try: | 484 try: |
| 489 raise _InternalException('expectations_json_file %s not found' % | 485 raise _InternalException('expectations_json_file %s not found' % |
| 490 expectations_json_file) | 486 expectations_json_file) |
| 491 except: | 487 except: |
| 492 exception_handler.RaiseExceptionOrContinue() | 488 exception_handler.RaiseExceptionOrContinue() |
| 493 | 489 |
| 494 exception_handler.ReportAllFailures() | 490 exception_handler.ReportAllFailures() |
| OLD | NEW |