Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2010 Google Inc. All rights reserved. | 1 # Copyright (c) 2010 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 280 | 280 |
| 281 | 281 |
| 282 class AbstractParallelRebaselineCommand(AbstractRebaseliningCommand): | 282 class AbstractParallelRebaselineCommand(AbstractRebaseliningCommand): |
| 283 """Base class for rebaseline commands that do some tasks in parallel.""" | 283 """Base class for rebaseline commands that do some tasks in parallel.""" |
| 284 # Not overriding execute() - pylint: disable=abstract-method | 284 # Not overriding execute() - pylint: disable=abstract-method |
| 285 | 285 |
| 286 def __init__(self, options=None): | 286 def __init__(self, options=None): |
| 287 super(AbstractParallelRebaselineCommand, self).__init__(options=options) | 287 super(AbstractParallelRebaselineCommand, self).__init__(options=options) |
| 288 | 288 |
| 289 @memoized | 289 @memoized |
| 290 def builder_data(self): | 290 def build_data(self): |
|
wkorman
2016/07/14 01:01:45
Helpful if we document what this returns key/value
qyearsley
2016/07/14 23:53:29
Done -- now added a docstring here, and now instea
| |
| 291 builder_to_results = {} | 291 build_to_results = {} |
| 292 for builder_name in self._release_builders(): | 292 for builder_name in self._release_builders(): |
| 293 builder = self._tool.buildbot.builder_with_name(builder_name) | 293 builder = self._tool.buildbot.builder_with_name(builder_name) |
| 294 builder_results = builder.latest_layout_test_results() | 294 builder_results = builder.latest_layout_test_results() |
| 295 if builder_results: | 295 if builder_results: |
| 296 builder_to_results[builder_name] = builder_results | 296 build_to_results[(builder_name, None)] = builder_results |
| 297 else: | 297 else: |
| 298 raise Exception("No result for builder %s." % builder_name) | 298 raise Exception("No result for builder %s." % builder_name) |
| 299 return builder_to_results | 299 return build_to_results |
| 300 | 300 |
| 301 # The release builders cycle much faster than the debug ones and cover all t he platforms. | 301 # The release builders cycle much faster than the debug ones and cover all t he platforms. |
| 302 def _release_builders(self): | 302 def _release_builders(self): |
| 303 release_builders = [] | 303 release_builders = [] |
| 304 for builder_name in self._tool.builders.all_continuous_builder_names(): | 304 for builder_name in self._tool.builders.all_continuous_builder_names(): |
| 305 if 'ASAN' in builder_name: | 305 if 'ASAN' in builder_name: |
| 306 continue | 306 continue |
| 307 port = self._tool.port_factory.get_from_builder_name(builder_name) | 307 port = self._tool.port_factory.get_from_builder_name(builder_name) |
| 308 if port.test_configuration().build_type == 'release': | 308 if port.test_configuration().build_type == 'release': |
| 309 release_builders.append(builder_name) | 309 release_builders.append(builder_name) |
| 310 return release_builders | 310 return release_builders |
| 311 | 311 |
| 312 def _run_webkit_patch(self, args, verbose): | 312 def _run_webkit_patch(self, args, verbose): |
| 313 try: | 313 try: |
| 314 verbose_args = ['--verbose'] if verbose else [] | 314 verbose_args = ['--verbose'] if verbose else [] |
| 315 stderr = self._tool.executive.run_command([self._tool.path()] + verb ose_args + | 315 stderr = self._tool.executive.run_command([self._tool.path()] + verb ose_args + |
| 316 args, cwd=self._tool.scm() .checkout_root, return_stderr=True) | 316 args, cwd=self._tool.scm() .checkout_root, return_stderr=True) |
| 317 for line in stderr.splitlines(): | 317 for line in stderr.splitlines(): |
| 318 _log.warning(line) | 318 _log.warning(line) |
| 319 except ScriptError: | 319 except ScriptError: |
| 320 traceback.print_exc(file=sys.stderr) | 320 traceback.print_exc(file=sys.stderr) |
| 321 | 321 |
| 322 def _builders_to_fetch_from(self, builders_to_check): | 322 def _builders_to_fetch_from(self, builders_to_check): |
| 323 """Returns the subset of builders that will cover all of the baseline se arch paths | 323 """Returns the subset of builders that will cover all of the baseline |
| 324 used in the input list. | 324 search paths used in the input list. |
| 325 | 325 |
| 326 In particular, if the input list contains both Release and Debug | 326 In particular, if the input list contains both Release and Debug |
| 327 versions of a configuration, we *only* return the Release version | 327 versions of a configuration, we *only* return the Release version |
| 328 (since we don't save debug versions of baselines). | 328 (since we don't save debug versions of baselines). |
| 329 | 329 |
| 330 Args: | 330 Args: |
| 331 builders_to_check: List of builder names. | 331 builders_to_check: List of builder names. |
| 332 """ | 332 """ |
| 333 release_builders = set() | 333 release_builders = set() |
| 334 debug_builders = set() | 334 debug_builders = set() |
| 335 builders_to_fallback_paths = {} | 335 builders_to_fallback_paths = {} |
| 336 for builder in builders_to_check: | 336 for builder in builders_to_check: |
| 337 port = self._tool.port_factory.get_from_builder_name(builder) | 337 port = self._tool.port_factory.get_from_builder_name(builder) |
| 338 if port.test_configuration().build_type == 'release': | 338 if port.test_configuration().build_type == 'release': |
| 339 release_builders.add(builder) | 339 release_builders.add(builder) |
| 340 else: | 340 else: |
| 341 debug_builders.add(builder) | 341 debug_builders.add(builder) |
| 342 for builder in list(release_builders) + list(debug_builders): | 342 for builder in list(release_builders) + list(debug_builders): |
| 343 port = self._tool.port_factory.get_from_builder_name(builder) | 343 port = self._tool.port_factory.get_from_builder_name(builder) |
| 344 fallback_path = port.baseline_search_path() | 344 fallback_path = port.baseline_search_path() |
| 345 if fallback_path not in builders_to_fallback_paths.values(): | 345 if fallback_path not in builders_to_fallback_paths.values(): |
| 346 builders_to_fallback_paths[builder] = fallback_path | 346 builders_to_fallback_paths[builder] = fallback_path |
| 347 return builders_to_fallback_paths.keys() | 347 return builders_to_fallback_paths.keys() |
| 348 | 348 |
| 349 def _rebaseline_commands(self, test_prefix_list, options, skip_checking_actu al_results=False): | 349 def _rebaseline_commands(self, test_prefix_list, options, skip_checking_actu al_results=False): |
| 350 path_to_webkit_patch = self._tool.path() | 350 path_to_webkit_patch = self._tool.path() |
| 351 cwd = self._tool.scm().checkout_root | 351 cwd = self._tool.scm().checkout_root |
| 352 copy_baseline_commands = [] | 352 copy_baseline_commands = [] |
| 353 rebaseline_commands = [] | 353 rebaseline_commands = [] |
| 354 lines_to_remove = {} | 354 lines_to_remove = {} |
| 355 port = self._tool.port_factory.get() | 355 port = self._tool.port_factory.get() |
| 356 | 356 |
| 357 for test_prefix in test_prefix_list: | 357 for test_prefix in test_prefix_list: |
| 358 for test in port.tests([test_prefix]): | 358 for test in port.tests([test_prefix]): |
| 359 for builder in self._builders_to_fetch_from(test_prefix_list[tes t_prefix]): | 359 builders_to_fetch_from = self._builders_to_fetch_from([b for b, _ in test_prefix_list[test_prefix]]) |
| 360 for build in test_prefix_list[test_prefix]: | |
| 360 # TODO(qyearsley): Remove the parameter skip_checking_actual _results | 361 # TODO(qyearsley): Remove the parameter skip_checking_actual _results |
| 361 # and instead refactor the existing code so that this is not necessary. | 362 # and instead refactor the existing code so that this is not necessary. |
| 363 builder, build_number = build | |
| 364 if builder not in builders_to_fetch_from: | |
| 365 break | |
| 362 if skip_checking_actual_results: | 366 if skip_checking_actual_results: |
| 363 actual_failures_suffixes = test_prefix_list[test_prefix] [builder] | 367 actual_failures_suffixes = test_prefix_list[test_prefix] [build] |
| 364 else: | 368 else: |
| 365 actual_failures_suffixes = self._suffixes_for_actual_fai lures( | 369 actual_failures_suffixes = self._suffixes_for_actual_fai lures( |
| 366 test, builder, test_prefix_list[test_prefix][builder ]) | 370 test, build, test_prefix_list[test_prefix][build]) |
| 367 if not actual_failures_suffixes: | 371 if not actual_failures_suffixes: |
| 368 # If we're not going to rebaseline the test because it's passing on this | 372 # If we're not going to rebaseline the test because it's passing on this |
| 369 # builder, we still want to remove the line from TestExp ectations. | 373 # builder, we still want to remove the line from TestExp ectations. |
| 370 if test not in lines_to_remove: | 374 if test not in lines_to_remove: |
| 371 lines_to_remove[test] = [] | 375 lines_to_remove[test] = [] |
| 372 lines_to_remove[test].append(builder) | 376 lines_to_remove[test].append(builder) |
| 373 continue | 377 continue |
| 374 | 378 |
| 375 suffixes = ','.join(actual_failures_suffixes) | 379 suffixes = ','.join(actual_failures_suffixes) |
| 376 cmd_line = ['--suffixes', suffixes, '--builder', builder, '- -test', test] | 380 cmd_line = ['--suffixes', suffixes, '--builder', builder, '- -test', test] |
| 381 if build_number: | |
| 382 cmd_line.extend(['--build-number', build_number]) | |
| 377 if options.results_directory: | 383 if options.results_directory: |
| 378 cmd_line.extend(['--results-directory', options.results_ directory]) | 384 cmd_line.extend(['--results-directory', options.results_ directory]) |
| 379 if options.verbose: | 385 if options.verbose: |
| 380 cmd_line.append('--verbose') | 386 cmd_line.append('--verbose') |
| 381 copy_baseline_commands.append( | 387 copy_baseline_commands.append( |
| 382 tuple([[self._tool.executable, path_to_webkit_patch, 'co py-existing-baselines-internal'] + cmd_line, cwd])) | 388 tuple([[self._tool.executable, path_to_webkit_patch, 'co py-existing-baselines-internal'] + cmd_line, cwd])) |
| 383 rebaseline_commands.append( | 389 rebaseline_commands.append( |
| 384 tuple([[self._tool.executable, path_to_webkit_patch, 're baseline-test-internal'] + cmd_line, cwd])) | 390 tuple([[self._tool.executable, path_to_webkit_patch, 're baseline-test-internal'] + cmd_line, cwd])) |
| 385 return copy_baseline_commands, rebaseline_commands, lines_to_remove | 391 return copy_baseline_commands, rebaseline_commands, lines_to_remove |
| 386 | 392 |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 411 | 417 |
| 412 if not file_added: | 418 if not file_added: |
| 413 _log.debug('Could not add file based off output "%s"' % output) | 419 _log.debug('Could not add file based off output "%s"' % output) |
| 414 | 420 |
| 415 return list(files_to_add), list(files_to_delete), lines_to_remove | 421 return list(files_to_add), list(files_to_delete), lines_to_remove |
| 416 | 422 |
| 417 def _optimize_baselines(self, test_prefix_list, verbose=False): | 423 def _optimize_baselines(self, test_prefix_list, verbose=False): |
| 418 optimize_commands = [] | 424 optimize_commands = [] |
| 419 for test in test_prefix_list: | 425 for test in test_prefix_list: |
| 420 all_suffixes = set() | 426 all_suffixes = set() |
| 421 for builder in self._builders_to_fetch_from(test_prefix_list[test]): | 427 builders_to_fetch_from = self._builders_to_fetch_from([b for b, _ in test_prefix_list[test]]) |
| 422 all_suffixes.update(self._suffixes_for_actual_failures(test, bui lder, test_prefix_list[test][builder])) | 428 for build in test_prefix_list[test]: |
| 429 builder, _ = build | |
| 430 if builder not in builders_to_fetch_from: | |
| 431 break | |
| 432 all_suffixes.update(self._suffixes_for_actual_failures(test, bui ld, test_prefix_list[test][build])) | |
| 423 | 433 |
| 424 # No need to optimize baselines for a test with no failures. | 434 # No need to optimize baselines for a test with no failures. |
| 425 if not all_suffixes: | 435 if not all_suffixes: |
| 426 continue | 436 continue |
| 427 | 437 |
| 428 # FIXME: We should propagate the platform options as well. | 438 # FIXME: We should propagate the platform options as well. |
| 429 cmd_line = ['--no-modify-scm', '--suffixes', ','.join(all_suffixes), test] | 439 cmd_line = ['--no-modify-scm', '--suffixes', ','.join(all_suffixes), test] |
| 430 if verbose: | 440 if verbose: |
| 431 cmd_line.append('--verbose') | 441 cmd_line.append('--verbose') |
| 432 | 442 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 495 if files_to_add: | 505 if files_to_add: |
| 496 self._tool.scm().add_list(files_to_add) | 506 self._tool.scm().add_list(files_to_add) |
| 497 return lines_to_remove | 507 return lines_to_remove |
| 498 | 508 |
| 499 def _rebaseline(self, options, test_prefix_list, skip_checking_actual_result s=False): | 509 def _rebaseline(self, options, test_prefix_list, skip_checking_actual_result s=False): |
| 500 """Downloads new baselines in parallel, then updates expectations files | 510 """Downloads new baselines in parallel, then updates expectations files |
| 501 and optimizes baselines. | 511 and optimizes baselines. |
| 502 | 512 |
| 503 Args: | 513 Args: |
| 504 options: An object with the options passed to the current command. | 514 options: An object with the options passed to the current command. |
| 505 test_prefix_list: A map of test names to builder names to baseline | 515 test_prefix_list: A map of test names to (builder name, build number ) |
| 506 suffixes to rebaseline. For example: | 516 pairs to baseline suffixes to rebaseline. For example: |
| 507 { | 517 { |
| 508 "some/test.html": {"builder-1": ["txt"], "builder-2": ["txt" ]}, | 518 "some/test.html": {("builder-1", 412): ["txt"], ("builder-2" , 100): ["txt"]}, |
| 509 "some/other.html": {"builder-1": ["txt"]} | 519 "some/other.html": {("builder-1", 412): ["txt"]} |
| 510 } | 520 } |
| 511 This would mean that new text baselines should be downloaded for | 521 This would mean that new text baselines should be downloaded for |
| 512 "some/test.html" on both builder-1 and builder-2, and new text | 522 "some/test.html" on both builder-1 (build 412) and builder-2 |
| 513 baselines should be downloaded for "some/other.html" but only | 523 (build 100), and new text baselines should be downloaded for |
| 514 from builder-1. | 524 "some/other.html" but only from builder-1. |
| 515 skip_checking_actual_results: If True, then the lists of suffixes | 525 skip_checking_actual_results: If True, then the lists of suffixes |
| 516 to rebaseline from |test_prefix_list| will be used directly; | 526 to rebaseline from |test_prefix_list| will be used directly; |
| 517 if False, then the list of suffixes will filtered to include | 527 if False, then the list of suffixes will filtered to include |
| 518 suffixes with mismatches in actual results. | 528 suffixes with mismatches in actual results. |
| 519 """ | 529 """ |
| 520 for test, builders_to_check in sorted(test_prefix_list.items()): | 530 for test, builds_to_check in sorted(test_prefix_list.items()): |
| 521 _log.info("Rebaselining %s" % test) | 531 _log.info("Rebaselining %s" % test) |
| 522 for builder, suffixes in sorted(builders_to_check.items()): | 532 for build, suffixes in sorted(builds_to_check.items()): |
| 523 _log.debug(" %s: %s" % (builder, ",".join(suffixes))) | 533 _log.debug(" %s: %s" % (build, ",".join(suffixes))) |
| 524 | 534 |
| 525 copy_baseline_commands, rebaseline_commands, extra_lines_to_remove = sel f._rebaseline_commands( | 535 copy_baseline_commands, rebaseline_commands, extra_lines_to_remove = sel f._rebaseline_commands( |
| 526 test_prefix_list, options, skip_checking_actual_results) | 536 test_prefix_list, options, skip_checking_actual_results) |
| 527 lines_to_remove = {} | 537 lines_to_remove = {} |
| 528 | 538 |
| 529 self._run_in_parallel_and_update_scm(copy_baseline_commands) | 539 self._run_in_parallel_and_update_scm(copy_baseline_commands) |
| 530 lines_to_remove = self._run_in_parallel_and_update_scm(rebaseline_comman ds) | 540 lines_to_remove = self._run_in_parallel_and_update_scm(rebaseline_comman ds) |
| 531 | 541 |
| 532 for test in extra_lines_to_remove: | 542 for test in extra_lines_to_remove: |
| 533 if test in lines_to_remove: | 543 if test in lines_to_remove: |
| 534 lines_to_remove[test] = lines_to_remove[test] + extra_lines_to_r emove[test] | 544 lines_to_remove[test] = lines_to_remove[test] + extra_lines_to_r emove[test] |
| 535 else: | 545 else: |
| 536 lines_to_remove[test] = extra_lines_to_remove[test] | 546 lines_to_remove[test] = extra_lines_to_remove[test] |
| 537 | 547 |
| 538 if lines_to_remove: | 548 if lines_to_remove: |
| 539 self._update_expectations_files(lines_to_remove) | 549 self._update_expectations_files(lines_to_remove) |
| 540 | 550 |
| 541 if options.optimize: | 551 if options.optimize: |
| 542 # TODO(wkorman): Consider changing temporary branch to base off of H EAD rather than | 552 # TODO(wkorman): Consider changing temporary branch to base off of H EAD rather than |
| 543 # origin/master to ensure we run baseline optimization processes wit h the same code as | 553 # origin/master to ensure we run baseline optimization processes wit h the same code as |
| 544 # auto-rebaseline itself. | 554 # auto-rebaseline itself. |
| 545 self._run_in_parallel_and_update_scm(self._optimize_baselines(test_p refix_list, options.verbose)) | 555 self._run_in_parallel_and_update_scm(self._optimize_baselines(test_p refix_list, options.verbose)) |
| 546 | 556 |
| 547 def _suffixes_for_actual_failures(self, test, builder_name, existing_suffixe s): | 557 def _suffixes_for_actual_failures(self, test, build, existing_suffixes): |
| 548 if builder_name not in self.builder_data(): | 558 """Gets the baseline suffixes for actual mismatch failures in some resul ts. |
| 559 | |
| 560 Args: | |
| 561 test: A full test path string. | |
| 562 build: A pair (builder_name, build_number). | |
| 563 existing_suffixes: A collection of all suffixes to consider. | |
| 564 | |
| 565 Returns: | |
| 566 A set of file suffix strings. | |
| 567 """ | |
| 568 if build not in self.build_data(): | |
| 549 return set() | 569 return set() |
| 550 test_result = self.builder_data()[builder_name].result_for_test(test) | 570 test_result = self.build_data()[build].result_for_test(test) |
| 551 if not test_result: | 571 if not test_result: |
| 552 return set() | 572 return set() |
| 553 return set(existing_suffixes) & TestExpectations.suffixes_for_test_resul t(test_result) | 573 return set(existing_suffixes) & TestExpectations.suffixes_for_test_resul t(test_result) |
| 554 | 574 |
| 555 | 575 |
| 556 class RebaselineJson(AbstractParallelRebaselineCommand): | 576 class RebaselineJson(AbstractParallelRebaselineCommand): |
| 557 name = "rebaseline-json" | 577 name = "rebaseline-json" |
| 558 help_text = "Rebaseline based off JSON passed to stdin. Intended to only be called from other scripts." | 578 help_text = "Rebaseline based off JSON passed to stdin. Intended to only be called from other scripts." |
| 559 | 579 |
| 560 def __init__(self,): | 580 def __init__(self,): |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 593 return | 613 return |
| 594 tests = self._tests_to_rebaseline(self._tool.port_factory.get(port_name) ).items() | 614 tests = self._tests_to_rebaseline(self._tool.port_factory.get(port_name) ).items() |
| 595 | 615 |
| 596 if tests: | 616 if tests: |
| 597 _log.info("Retrieving results for %s from %s." % (port_name, builder _name)) | 617 _log.info("Retrieving results for %s from %s." % (port_name, builder _name)) |
| 598 | 618 |
| 599 for test_name, suffixes in tests: | 619 for test_name, suffixes in tests: |
| 600 _log.info(" %s (%s)" % (test_name, ','.join(suffixes))) | 620 _log.info(" %s (%s)" % (test_name, ','.join(suffixes))) |
| 601 if test_name not in self._test_prefix_list: | 621 if test_name not in self._test_prefix_list: |
| 602 self._test_prefix_list[test_name] = {} | 622 self._test_prefix_list[test_name] = {} |
| 603 self._test_prefix_list[test_name][builder_name] = suffixes | 623 self._test_prefix_list[test_name][(builder_name, None)] = suffixes |
| 604 | 624 |
| 605 def execute(self, options, args, tool): | 625 def execute(self, options, args, tool): |
| 606 options.results_directory = None | 626 options.results_directory = None |
| 607 self._test_prefix_list = {} | 627 self._test_prefix_list = {} |
| 608 port_names = tool.port_factory.all_port_names(options.platform) | 628 port_names = tool.port_factory.all_port_names(options.platform) |
| 609 for port_name in port_names: | 629 for port_name in port_names: |
| 610 self._add_tests_to_rebaseline_for_port(port_name) | 630 self._add_tests_to_rebaseline_for_port(port_name) |
| 611 if not self._test_prefix_list: | 631 if not self._test_prefix_list: |
| 612 _log.warning("Did not find any tests marked Rebaseline.") | 632 _log.warning("Did not find any tests marked Rebaseline.") |
| 613 return | 633 return |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 651 else: | 671 else: |
| 652 builders_to_check = self._builders_to_pull_from() | 672 builders_to_check = self._builders_to_pull_from() |
| 653 | 673 |
| 654 test_prefix_list = {} | 674 test_prefix_list = {} |
| 655 suffixes_to_update = options.suffixes.split(",") | 675 suffixes_to_update = options.suffixes.split(",") |
| 656 | 676 |
| 657 for builder in builders_to_check: | 677 for builder in builders_to_check: |
| 658 for test in args: | 678 for test in args: |
| 659 if test not in test_prefix_list: | 679 if test not in test_prefix_list: |
| 660 test_prefix_list[test] = {} | 680 test_prefix_list[test] = {} |
| 661 test_prefix_list[test][builder.name()] = suffixes_to_update | 681 test_prefix_list[test][(builder.name(), None)] = suffixes_to_upd ate |
| 662 | 682 |
| 663 if options.verbose: | 683 if options.verbose: |
| 664 _log.debug("rebaseline-json: " + str(test_prefix_list)) | 684 _log.debug("rebaseline-json: " + str(test_prefix_list)) |
| 665 | 685 |
| 686 print(test_prefix_list) | |
|
wkorman
2016/07/14 01:01:46
Debugging
qyearsley
2016/07/14 23:53:29
Now removed
| |
| 666 self._rebaseline(options, test_prefix_list) | 687 self._rebaseline(options, test_prefix_list) |
| 667 | 688 |
| 668 | 689 |
| 669 class AutoRebaseline(AbstractParallelRebaselineCommand): | 690 class AutoRebaseline(AbstractParallelRebaselineCommand): |
| 670 name = "auto-rebaseline" | 691 name = "auto-rebaseline" |
| 671 help_text = "Rebaselines any NeedsRebaseline lines in TestExpectations that have cycled through all the bots." | 692 help_text = "Rebaselines any NeedsRebaseline lines in TestExpectations that have cycled through all the bots." |
| 672 AUTO_REBASELINE_BRANCH_NAME = "auto-rebaseline-temporary-branch" | 693 AUTO_REBASELINE_BRANCH_NAME = "auto-rebaseline-temporary-branch" |
| 673 AUTO_REBASELINE_ALT_BRANCH_NAME = "auto-rebaseline-alt-temporary-branch" | 694 AUTO_REBASELINE_ALT_BRANCH_NAME = "auto-rebaseline-alt-temporary-branch" |
| 674 | 695 |
| 675 # Rietveld uploader stinks. Limit the number of rebaselines in a given patch to keep upload from failing. | 696 # Rietveld uploader stinks. Limit the number of rebaselines in a given patch to keep upload from failing. |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 698 @ | 719 @ |
| 699 [^@>]+ # Domain terminated by @ or >, some lines have an ad ditional @ fragment after the email. | 720 [^@>]+ # Domain terminated by @ or >, some lines have an ad ditional @ fragment after the email. |
| 700 ) | 721 ) |
| 701 .*?([^ ]*) # Test file name | 722 .*?([^ ]*) # Test file name |
| 702 \ \[ # Single space followed by opening [ for expectation specifier | 723 \ \[ # Single space followed by opening [ for expectation specifier |
| 703 [^[]*$ # Prevents matching previous [ for version specifier s instead of expectation specifiers | 724 [^[]*$ # Prevents matching previous [ for version specifier s instead of expectation specifiers |
| 704 """, re.VERBOSE) | 725 """, re.VERBOSE) |
| 705 | 726 |
| 706 def bot_revision_data(self, scm): | 727 def bot_revision_data(self, scm): |
| 707 revisions = [] | 728 revisions = [] |
| 708 for result in self.builder_data().values(): | 729 for result in self.build_data().values(): |
| 709 if result.run_was_interrupted(): | 730 if result.run_was_interrupted(): |
| 710 _log.error("Can't rebaseline because the latest run on %s exited early." % result.builder_name()) | 731 _log.error("Can't rebaseline because the latest run on %s exited early." % result.builder_name()) |
| 711 return [] | 732 return [] |
| 712 revisions.append({ | 733 revisions.append({ |
| 713 "builder": result.builder_name(), | 734 "builder": result.builder_name(), |
| 714 "revision": result.chromium_revision(scm), | 735 "revision": result.chromium_revision(scm), |
| 715 }) | 736 }) |
| 716 return revisions | 737 return revisions |
| 717 | 738 |
| 718 def _strip_comments(self, line): | 739 def _strip_comments(self, line): |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 798 port = self._tool.port_factory.get(port_name) | 819 port = self._tool.port_factory.get(port_name) |
| 799 expectations = TestExpectations(port, include_overrides=True) | 820 expectations = TestExpectations(port, include_overrides=True) |
| 800 for test in expectations.get_needs_rebaseline_failures(): | 821 for test in expectations.get_needs_rebaseline_failures(): |
| 801 if test not in tests: | 822 if test not in tests: |
| 802 continue | 823 continue |
| 803 | 824 |
| 804 if test not in test_prefix_list: | 825 if test not in test_prefix_list: |
| 805 lines_to_remove[test] = [] | 826 lines_to_remove[test] = [] |
| 806 test_prefix_list[test] = {} | 827 test_prefix_list[test] = {} |
| 807 lines_to_remove[test].append(builder_name) | 828 lines_to_remove[test].append(builder_name) |
| 808 test_prefix_list[test][builder_name] = BASELINE_SUFFIX_LIST | 829 test_prefix_list[test][(builder_name, None)] = BASELINE_SUFFIX_L IST |
| 809 | 830 |
| 810 return test_prefix_list, lines_to_remove | 831 return test_prefix_list, lines_to_remove |
| 811 | 832 |
| 812 def _run_git_cl_command(self, options, command): | 833 def _run_git_cl_command(self, options, command): |
| 813 subprocess_command = ['git', 'cl'] + command | 834 subprocess_command = ['git', 'cl'] + command |
| 814 if options.verbose: | 835 if options.verbose: |
| 815 subprocess_command.append('--verbose') | 836 subprocess_command.append('--verbose') |
| 816 if options.auth_refresh_token_json: | 837 if options.auth_refresh_token_json: |
| 817 subprocess_command.append('--auth-refresh-token-json') | 838 subprocess_command.append('--auth-refresh-token-json') |
| 818 subprocess_command.append(options.auth_refresh_token_json) | 839 subprocess_command.append(options.auth_refresh_token_json) |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 925 issue_already_closed = tool.executive.run_command( | 946 issue_already_closed = tool.executive.run_command( |
| 926 ['git', 'config', 'branch.%s.rietveldissue' % rebaseline _branch_name], | 947 ['git', 'config', 'branch.%s.rietveldissue' % rebaseline _branch_name], |
| 927 return_exit_code=True) | 948 return_exit_code=True) |
| 928 if not issue_already_closed: | 949 if not issue_already_closed: |
| 929 self._run_git_cl_command(options, ['set_close']) | 950 self._run_git_cl_command(options, ['set_close']) |
| 930 | 951 |
| 931 tool.scm().ensure_cleanly_tracking_remote_master() | 952 tool.scm().ensure_cleanly_tracking_remote_master() |
| 932 if old_branch_name_or_ref: | 953 if old_branch_name_or_ref: |
| 933 tool.scm().checkout_branch(old_branch_name_or_ref) | 954 tool.scm().checkout_branch(old_branch_name_or_ref) |
| 934 tool.scm().delete_branch(rebaseline_branch_name) | 955 tool.scm().delete_branch(rebaseline_branch_name) |
| OLD | NEW |