Changeset 92634 in webkit
- Timestamp:
- Aug 8, 2011 2:28:03 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r92632 r92634 1 2011-08-08 Dimitri Glazkov <dglazkov@chromium.org> 2 3 TestExpectationsEditor should return a list of updated expectations. 4 https://bugs.webkit.org/show_bug.cgi?id=65872 5 6 Reviewed by Adam Barth. 7 8 * Scripts/webkitpy/layout_tests/models/test_expectations.py: Added a list to store lines that are being updated. 9 * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py: Changed tests to account for updated lines. 10 1 11 2011-08-08 Jochen Eisinger <jochen@chromium.org> 2 12 -
trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
r92493 r92634 642 642 """ 643 643 # FIXME: Allow specifying modifiers (SLOW, SKIP, WONTFIX). 644 updated_expectations = [] 644 645 expectation_lines = self._test_to_expectation_lines.get(test, []) 645 646 remaining_configurations = test_config_set.copy() … … 650 651 # Tweak expectations on existing line. 651 652 if expectation_line.parsed_expectations == expectation_set: 652 return 653 return updated_expectations 653 654 self._bug_manager.close_bug(expectation_line.parsed_bug_modifiers, bug_ids) 655 updated_expectations.append(expectation_line) 654 656 if remove_expectations: 655 657 expectation_line.matching_configurations = set() 656 return657 expectation_line.parsed_expectations = expectation_set658 expectation_line.parsed_bug_modifiers = bug_ids659 return 658 else: 659 expectation_line.parsed_expectations = expectation_set 660 expectation_line.parsed_bug_modifiers = bug_ids 661 return updated_expectations 660 662 elif expectation_line.matching_configurations >= remaining_configurations: 661 663 # 1) Split up into two expectation lines: … … 664 666 # 2) Finish looking, since there will be no more remaining configs to test for. 665 667 expectation_line.matching_configurations -= remaining_configurations 668 updated_expectations.append(expectation_line) 666 669 break 667 670 elif expectation_line.matching_configurations <= remaining_configurations: … … 669 672 self._bug_manager.close_bug(expectation_line.parsed_bug_modifiers, bug_ids) 670 673 expectation_line.matching_configurations = set() 674 updated_expectations.append(expectation_line) 671 675 else: 672 676 intersection = expectation_line.matching_configurations & remaining_configurations 673 677 if intersection: 674 678 expectation_line.matching_configurations -= intersection 679 updated_expectations.append(expectation_line) 675 680 676 681 if not remove_expectations: 677 self._expectation_lines.append(self._create_new_line(test, bug_ids, remaining_configurations, expectation_set)) 682 new_expectation_line = self._create_new_line(test, bug_ids, remaining_configurations, expectation_set) 683 updated_expectations.append(new_expectation_line) 684 self._expectation_lines.append(new_expectation_line) 685 686 return updated_expectations 678 687 679 688 def _get_valid_bug_ids(self, suggested_bug_ids): -
trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
r92317 r92634 634 634 self.assertEquals(result, expected_string) 635 635 636 def assert_update_roundtrip(self, in_string, test, expectation_set, expected_string, remove_flakes=False, parsed_bug_modifiers=None, test_configs=None):636 def assert_update_roundtrip(self, in_string, test, expectation_set, expected_string, expected_update_count, remove_flakes=False, parsed_bug_modifiers=None, test_configs=None): 637 637 test_config_set = test_configs or set([self.test_port.test_configuration()]) 638 638 expectation_lines = self.make_parsed_expectation_lines(in_string) 639 639 editor = TestExpectationsEditor(expectation_lines, MockBugManager()) 640 editor.update_expectation(test, test_config_set, expectation_set, parsed_bug_modifiers=parsed_bug_modifiers) 640 updated_expectation_lines = editor.update_expectation(test, test_config_set, expectation_set, parsed_bug_modifiers=parsed_bug_modifiers) 641 for updated_expectation_line in updated_expectation_lines: 642 self.assertTrue(updated_expectation_line in expectation_lines) 643 self.assertEquals(len(updated_expectation_lines), expected_update_count) 641 644 converter = TestConfigurationConverter(self.test_port.all_test_configurations(), self.test_port.configuration_specifier_macros()) 642 645 result = TestExpectationSerializer.list_to_string(expectation_lines, converter) … … 779 782 self.assert_update_roundtrip(""" 780 783 BUGX1 XP RELEASE CPU : failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([IMAGE]), """ 781 BUG_NEWLY_CREATED XP RELEASE CPU : failures/expected/keyboard.html = IMAGE""" )782 783 self.assert_update_roundtrip(""" 784 BUGX1 XP RELEASE CPU : failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([PASS]), '' )784 BUG_NEWLY_CREATED XP RELEASE CPU : failures/expected/keyboard.html = IMAGE""", 1) 785 786 self.assert_update_roundtrip(""" 787 BUGX1 XP RELEASE CPU : failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([PASS]), '', 1) 785 788 786 789 self.assert_update_roundtrip(""" 787 790 BUGX1 XP RELEASE CPU : failures/expected = TEXT""", 'failures/expected/keyboard.html', set([IMAGE]), """ 788 791 BUGX1 XP RELEASE CPU : failures/expected = TEXT 789 BUG_NEWLY_CREATED XP RELEASE CPU : failures/expected/keyboard.html = IMAGE""" )792 BUG_NEWLY_CREATED XP RELEASE CPU : failures/expected/keyboard.html = IMAGE""", 1) 790 793 791 794 self.assert_update_roundtrip(""" 792 795 BUGX1 XP RELEASE CPU : failures/expected = TEXT""", 'failures/expected/keyboard.html', set([PASS]), """ 793 796 BUGX1 XP RELEASE CPU : failures/expected = TEXT 794 BUG_NEWLY_CREATED XP RELEASE CPU : failures/expected/keyboard.html = PASS""" )797 BUG_NEWLY_CREATED XP RELEASE CPU : failures/expected/keyboard.html = PASS""", 1) 795 798 796 799 self.assert_update_roundtrip(""" 797 800 BUGX1 XP RELEASE CPU : failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([TEXT]), """ 798 BUGX1 XP RELEASE CPU : failures/expected/keyboard.html = TEXT""" )801 BUGX1 XP RELEASE CPU : failures/expected/keyboard.html = TEXT""", 0) 799 802 800 803 self.assert_update_roundtrip(""" 801 804 BUGX1 XP RELEASE CPU : failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([IMAGE]), """ 802 BUGAWESOME XP RELEASE CPU : failures/expected/keyboard.html = IMAGE""", parsed_bug_modifiers=['BUGAWESOME'])805 BUGAWESOME XP RELEASE CPU : failures/expected/keyboard.html = IMAGE""", 1, parsed_bug_modifiers=['BUGAWESOME']) 803 806 804 807 self.assert_update_roundtrip(""" 805 808 BUGX1 XP RELEASE : failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([IMAGE]), """ 806 809 BUGX1 XP RELEASE GPU : failures/expected/keyboard.html = TEXT 807 BUG_NEWLY_CREATED XP RELEASE CPU : failures/expected/keyboard.html = IMAGE""" )810 BUG_NEWLY_CREATED XP RELEASE CPU : failures/expected/keyboard.html = IMAGE""", 2) 808 811 809 812 self.assert_update_roundtrip(""" 810 813 BUGX1 XP RELEASE : failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([PASS]), """ 811 BUGX1 XP RELEASE GPU : failures/expected/keyboard.html = TEXT""" )814 BUGX1 XP RELEASE GPU : failures/expected/keyboard.html = TEXT""", 1) 812 815 813 816 self.assert_update_roundtrip(""" 814 817 BUGX1 XP RELEASE : failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([IMAGE]), """ 815 818 BUGX1 XP RELEASE GPU : failures/expected/keyboard.html = TEXT 816 BUGAWESOME XP RELEASE CPU : failures/expected/keyboard.html = IMAGE""", parsed_bug_modifiers=['BUGAWESOME'])819 BUGAWESOME XP RELEASE CPU : failures/expected/keyboard.html = IMAGE""", 2, parsed_bug_modifiers=['BUGAWESOME']) 817 820 818 821 self.assert_update_roundtrip(""" … … 821 824 BUGX1 XP GPU : failures/expected/keyboard.html = TEXT 822 825 BUGX1 VISTA WIN7 : failures/expected/keyboard.html = TEXT 823 BUG_NEWLY_CREATED XP RELEASE CPU : failures/expected/keyboard.html = IMAGE""" )826 BUG_NEWLY_CREATED XP RELEASE CPU : failures/expected/keyboard.html = IMAGE""", 2) 824 827 825 828 self.assert_update_roundtrip(""" … … 827 830 BUGX1 XP DEBUG CPU : failures/expected/keyboard.html = TEXT 828 831 BUGX1 XP GPU : failures/expected/keyboard.html = TEXT 829 BUGX1 VISTA WIN7 : failures/expected/keyboard.html = TEXT""" )832 BUGX1 VISTA WIN7 : failures/expected/keyboard.html = TEXT""", 1) 830 833 831 834 self.assert_update_roundtrip(""" … … 834 837 BUGX1 XP GPU : failures/expected/keyboard.html = TEXT 835 838 BUGX1 VISTA WIN7 : failures/expected/keyboard.html = TEXT 836 BUG_NEWLY_CREATED XP RELEASE CPU : failures/expected/keyboard.html = IMAGE""" )839 BUG_NEWLY_CREATED XP RELEASE CPU : failures/expected/keyboard.html = IMAGE""", 2) 837 840 838 841 self.assert_update_roundtrip(""" 839 842 BUGX1 XP RELEASE CPU: failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([IMAGE]), """ 840 BUG_NEWLY_CREATED WIN RELEASE CPU : failures/expected/keyboard.html = IMAGE""", test_configs=self.WIN_RELEASE_CPU_CONFIGS)841 842 self.assert_update_roundtrip(""" 843 BUGX1 XP RELEASE CPU: failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([PASS]), '', test_configs=self.WIN_RELEASE_CPU_CONFIGS)843 BUG_NEWLY_CREATED WIN RELEASE CPU : failures/expected/keyboard.html = IMAGE""", 2, test_configs=self.WIN_RELEASE_CPU_CONFIGS) 844 845 self.assert_update_roundtrip(""" 846 BUGX1 XP RELEASE CPU: failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([PASS]), '', 1, test_configs=self.WIN_RELEASE_CPU_CONFIGS) 844 847 845 848 self.assert_update_roundtrip(""" 846 849 BUGX1 RELEASE CPU: failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([IMAGE]), """ 847 850 BUGX1 LINUX MAC RELEASE CPU : failures/expected/keyboard.html = TEXT 848 BUG_NEWLY_CREATED WIN RELEASE CPU : failures/expected/keyboard.html = IMAGE""", test_configs=self.WIN_RELEASE_CPU_CONFIGS)851 BUG_NEWLY_CREATED WIN RELEASE CPU : failures/expected/keyboard.html = IMAGE""", 2, test_configs=self.WIN_RELEASE_CPU_CONFIGS) 849 852 850 853 self.assert_update_roundtrip(""" 851 854 BUGX1 MAC : failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([IMAGE]), """ 852 855 BUGX1 MAC : failures/expected/keyboard.html = TEXT 853 BUG_NEWLY_CREATED WIN RELEASE CPU : failures/expected/keyboard.html = IMAGE""", test_configs=self.WIN_RELEASE_CPU_CONFIGS)856 BUG_NEWLY_CREATED WIN RELEASE CPU : failures/expected/keyboard.html = IMAGE""", 1, test_configs=self.WIN_RELEASE_CPU_CONFIGS) 854 857 855 858 def test_update_expectation_multiple(self):
Note: See TracChangeset
for help on using the changeset viewer.