Changeset 92636 in webkit
- Timestamp:
- Aug 8, 2011 2:35:08 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r92634 r92636 1 2011-08-08 Dimitri Glazkov <dglazkov@chromium.org> 2 3 garden-o-matic should only touch expectations that need updating. 4 https://bugs.webkit.org/show_bug.cgi?id=65876 5 6 Reviewed by Adam Barth. 7 8 * Scripts/webkitpy/layout_tests/models/test_expectations.py: Added reconstitute_only_these to TestExpectationSerializer.list_to_string, 9 so that a caller could influence which lines to serialize from values. 10 * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py: Added tests. 11 * Scripts/webkitpy/tool/servers/gardeningserver.py: Started using reconstitute_only_these. 12 * Scripts/webkitpy/tool/servers/gardeningserver_unittest.py: Added tests. 13 1 14 2011-08-08 Dimitri Glazkov <dglazkov@chromium.org> 2 15 -
trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
r92634 r92636 167 167 168 168 @classmethod 169 def list_to_string(cls, expectation_lines, test_configuration_converter ):169 def list_to_string(cls, expectation_lines, test_configuration_converter, reconstitute_only_these=None): 170 170 serializer = cls(test_configuration_converter) 171 return "\n".join([line for line in [serializer.to_string(expectation_line) for expectation_line in expectation_lines] if line is not None]) 171 172 def serialize(expectation_line): 173 if not reconstitute_only_these or expectation_line in reconstitute_only_these: 174 return serializer.to_string(expectation_line) 175 return expectation_line.original_string 176 177 def nones_out(expectation_line): 178 return expectation_line is not None 179 180 return "\n".join(filter(nones_out, map(serialize, expectation_lines))) 172 181 173 182 -
trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
r92634 r92636 465 465 def __init__(self, testFunc): 466 466 test_port = port.get('test-win-xp', None) 467 self._serializer = TestExpectationSerializer(TestConfigurationConverter(test_port.all_test_configurations(), test_port.configuration_specifier_macros())) 467 self._converter = TestConfigurationConverter(test_port.all_test_configurations(), test_port.configuration_specifier_macros()) 468 self._serializer = TestExpectationSerializer(self._converter) 468 469 unittest.TestCase.__init__(self, testFunc) 469 470 … … 478 479 if expected_string is None: 479 480 expected_string = in_string 480 self.assertEqual(expected_string, TestExpectationSerializer.list_to_string(expectations, SpecifierSorter()))481 self.assertEqual(expected_string, TestExpectationSerializer.list_to_string(expectations, self._converter)) 481 482 482 483 def test_unparsed_to_string(self): … … 540 541 expectation_line.parsed_modifiers = ['garden-o-matic', 'total', 'is'] 541 542 self.assertEqual(self._serializer._parsed_modifier_string(expectation_line, ['win']), 'garden-o-matic is total win') 542 543 543 544 544 def test_format_result(self): … … 578 578 self.assert_list_round_trip('bar\n//Qux.\n') 579 579 580 def test_reconstitute_only_these(self): 581 lines = [] 582 reconstitute_only_these = [] 583 584 def add_line(matching_configurations, reconstitute): 585 expectation_line = TestExpectationLine() 586 expectation_line.original_string = "Nay" 587 expectation_line.parsed_bug_modifiers = ['BUGX'] 588 expectation_line.name = 'Yay' 589 expectation_line.parsed_expectations = set([IMAGE]) 590 expectation_line.matching_configurations = matching_configurations 591 lines.append(expectation_line) 592 if reconstitute: 593 reconstitute_only_these.append(expectation_line) 594 595 add_line(set([TestConfiguration(None, 'xp', 'x86', 'release', 'cpu')]), False) 596 add_line(set([TestConfiguration(None, 'xp', 'x86', 'release', 'cpu'), TestConfiguration(None, 'xp', 'x86', 'release', 'gpu')]), True) 597 add_line(set([TestConfiguration(None, 'xp', 'x86', 'release', 'cpu'), TestConfiguration(None, 'xp', 'x86', 'debug', 'gpu')]), False) 598 serialized = TestExpectationSerializer.list_to_string(lines, self._converter) 599 self.assertEquals(serialized, "BUGX XP RELEASE CPU : Yay = IMAGE\nBUGX XP RELEASE : Yay = IMAGE\nBUGX XP RELEASE CPU : Yay = IMAGE\nBUGX XP DEBUG GPU : Yay = IMAGE") 600 serialized = TestExpectationSerializer.list_to_string(lines, self._converter, reconstitute_only_these=reconstitute_only_these) 601 self.assertEquals(serialized, "Nay\nBUGX XP RELEASE : Yay = IMAGE\nNay") 602 580 603 def test_string_whitespace_stripping(self): 581 604 self.assert_round_trip('\n', '') -
trunk/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py
r92624 r92636 56 56 self._parser.parse(expectation_line) 57 57 editor = TestExpectationsEditor(expectation_lines, self) 58 updated_expectation_lines = [] 58 59 for failure_info in failure_info_list: 59 60 expectation_set = set(filter(None, map(TestExpectations.expectation_from_string, failure_info['failureTypeList']))) … … 61 62 test_name = failure_info['testName'] 62 63 assert(test_name) 63 editor.update_expectation(test_name, set([self._builder_to_test_config(failure_info['builderName'])]), expectation_set)64 self._tool.filesystem.write_text_file(self._path_to_test_expectations_file, TestExpectationSerializer.list_to_string(expectation_lines, self._converter ))64 updated_expectation_lines.extend(editor.update_expectation(test_name, set([self._builder_to_test_config(failure_info['builderName'])]), expectation_set)) 65 self._tool.filesystem.write_text_file(self._path_to_test_expectations_file, TestExpectationSerializer.list_to_string(expectation_lines, self._converter, reconstitute_only_these=updated_expectation_lines)) 65 66 66 67 -
trunk/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py
r92624 r92636 142 142 self.assert_update(failure_info_list, expectations_before=expectations_before, expectations_after=expectations_after) 143 143 144 def test_spurious_updates(self): 145 failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Webkit Win", "failureTypeList": ["IMAGE"]}] 146 expectations_before = "BUG_OLDER MAC LINUX : failures/expected/image.html = IMAGE+TEXT\nBUG_OLD XP RELEASE CPU : failures/expected/image.html = TEXT" 147 expectations_after = "BUG_OLDER MAC LINUX : failures/expected/image.html = IMAGE+TEXT\nBUG_NEW XP RELEASE CPU : failures/expected/image.html = IMAGE" 148 self.assert_update(failure_info_list, expectations_before=expectations_before, expectations_after=expectations_after) 149 144 150 145 151 class GardeningServerTest(unittest.TestCase):
Note: See TracChangeset
for help on using the changeset viewer.