Changeset 128385 in webkit
- Timestamp:
- Sep 12, 2012 5:09:32 PM (12 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout.js
r118234 r128385 67 67 }; 68 68 69 checkout.updateExpectations = function(failureInfoList, callback, checkoutUnavailable)70 {71 callIfCheckoutAvailable(function() {72 net.post(config.kLocalServerURL + '/updateexpectations', JSON.stringify(failureInfoList), function() {73 callback();74 });75 }, checkoutUnavailable);76 };77 78 69 checkout.rollout = function(revision, reason, callback, checkoutUnavailable) 79 70 { -
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout_unittests.js
r121294 r128385 30 30 test("subversionURLForTest", 1, function() { 31 31 equals(checkout.subversionURLForTest("path/to/test.html"), "http://svn.webkit.org/repository/webkit/trunk/LayoutTests/path/to/test.html"); 32 });33 34 test("updateExpectations", 4, function() {35 var simulator = new NetworkSimulator();36 37 // FIXME: This leaks state into g_haveSeenCheckoutAvailable, which is global.38 simulator.ajax = function(options) { options.success.call(); },39 40 simulator.post = function(url, data, callback)41 {42 equals(url, 'http://127.0.0.1:8127/updateexpectations');43 equals(data, '[{"builderName":"WebKit Linux","testName":"another/test.svg"}]');44 simulator.scheduleCallback(callback);45 };46 47 simulator.runTest(function() {48 checkout.updateExpectations([{49 'builderName': 'WebKit Linux',50 'testName': 'another/test.svg',51 }], function() {52 ok(true);53 }, function() {54 ok(false);55 });56 });57 32 }); 58 33 -
trunk/Tools/ChangeLog
r128381 r128385 1 2012-09-12 Dirk Pranke <dpranke@chromium.org> 2 3 remove unused testexpectations editing code from webkitpy, garden-o-matic 4 https://bugs.webkit.org/show_bug.cgi?id=96562 5 6 Reviewed by Adam Barth. 7 8 This code was prototyped but never fully realized. Removing 9 until it reanimates :). 10 11 * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout.js: 12 * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout_unittests.js: 13 * Scripts/webkitpy/layout_tests/controllers/test_expectations_editor.py: Removed. 14 * Scripts/webkitpy/layout_tests/controllers/test_expectations_editor_unittest.py: Removed. 15 * Scripts/webkitpy/tool/servers/gardeningserver.py: 16 (BuildCoverageExtrapolator.extrapolate_test_configurations): 17 (GardeningHTTPRequestHandler._run_webkit_patch): 18 (GardeningHTTPRequestHandler.ping): 19 * Scripts/webkitpy/tool/servers/gardeningserver_unittest.py: 20 (BuildCoverageExtrapolatorTest.test_extrapolate): 21 (GardeningServerTest.test_rebaseline_new_port): 22 1 23 2012-09-12 Lucas Forschler <lforschler@apple.com> 2 24 -
trunk/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py
r126334 r128385 30 30 from webkitpy.common.memoized import memoized 31 31 from webkitpy.tool.servers.reflectionhandler import ReflectionHandler 32 from webkitpy.layout_tests.controllers.test_expectations_editor import BugManager, TestExpectationsEditor33 from webkitpy.layout_tests.models.test_expectations import TestExpectationParser, TestExpectations34 from webkitpy.layout_tests.models.test_configuration import TestConfigurationConverter35 32 from webkitpy.layout_tests.port import builders 36 33 … … 52 49 def extrapolate_test_configurations(self, builder_name): 53 50 return self._covered_test_configurations_for_builder_name()[builder_name] 54 55 56 class GardeningExpectationsUpdater(BugManager):57 def __init__(self, tool, port):58 self._converter = TestConfigurationConverter(port.all_test_configurations(), port.configuration_specifier_macros())59 self._extrapolator = BuildCoverageExtrapolator(self._converter)60 self._parser = TestExpectationParser(port, [], allow_rebaseline_modifier=False)61 self._path_to_test_expectations_file = port.path_to_test_expectations_file()62 self._tool = tool63 64 def close_bug(self, bug_id, reference_bug_id=None):65 # FIXME: Implement this properly.66 pass67 68 def create_bug(self):69 return "BUG_NEW"70 71 def update_expectations(self, failure_info_list):72 expectation_lines = self._parser.parse(self._path_to_test_expectations_file, self._tool.filesystem.read_text_file(self._path_to_test_expectations_file))73 editor = TestExpectationsEditor(expectation_lines, self)74 updated_expectation_lines = []75 # FIXME: Group failures by testName+failureTypeList.76 for failure_info in failure_info_list:77 expectation_set = set(filter(lambda expectation: expectation is not None,78 map(TestExpectations.expectation_from_string, failure_info['failureTypeList'])))79 assert(expectation_set)80 test_name = failure_info['testName']81 assert(test_name)82 builder_name = failure_info['builderName']83 affected_test_configuration_set = self._extrapolator.extrapolate_test_configurations(builder_name)84 updated_expectation_lines.extend(editor.update_expectation(test_name, affected_test_configuration_set, expectation_set))85 self._tool.filesystem.write_text_file(self._path_to_test_expectations_file, TestExpectations.list_to_string(expectation_lines, self._converter, reconstitute_only_these=updated_expectation_lines))86 51 87 52 … … 115 80 return self.server.tool.executive.run_command([self.server.tool.path()] + args, cwd=self.server.tool.scm().checkout_root) 116 81 117 @memoized118 def _expectations_updater(self):119 # FIXME: Should split failure_info_list into lists per port, then edit each expectations file separately.120 # For now, assume Chromium port.121 port = self.server.tool.get("chromium-win-win7")122 return GardeningExpectationsUpdater(self.server.tool, port)123 124 82 def rollout(self): 125 83 revision = self.query['revision'][0] … … 137 95 self._serve_text('pong') 138 96 139 def updateexpectations(self):140 self._expectations_updater().update_expectations(self._read_entity_body_as_json())141 self._serve_text('success')142 143 97 def rebaselineall(self): 144 98 command = ['rebaseline-json'] -
trunk/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py
r121759 r128385 98 98 99 99 100 class GardeningExpectationsUpdaterTest(unittest.TestCase):101 def __init__(self, testFunc):102 self.tool = MockTool()103 self.tool.executive = MockExecutive(should_log=True)104 self.tool.filesystem.files[TestPortFactory.path_to_test_expectations_file()] = ""105 unittest.TestCase.__init__(self, testFunc)106 107 def assert_update(self, failure_info_list, expectations_before=None, expectations_after=None, expected_exception=None):108 updater = GardeningExpectationsUpdater(self.tool, TestPortFactory.create())109 path_to_test_expectations_file = TestPortFactory.path_to_test_expectations_file()110 self.tool.filesystem.files[path_to_test_expectations_file] = expectations_before or ""111 if expected_exception:112 self.assertRaises(expected_exception, updater.update_expectations, (failure_info_list))113 else:114 updater.update_expectations(failure_info_list)115 self.assertEquals(self.tool.filesystem.files[path_to_test_expectations_file], expectations_after)116 117 def test_empty_expectations(self):118 failure_info_list = []119 expectations_before = ""120 expectations_after = ""121 self.assert_update(failure_info_list, expectations_before=expectations_before, expectations_after=expectations_after)122 123 def test_unknown_builder(self):124 failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Bob", "failureTypeList": ["IMAGE"]}]125 self.assert_update(failure_info_list, expected_exception=KeyError)126 127 def test_empty_failure_type_list(self):128 failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Webkit Win", "failureTypeList": []}]129 self.assert_update(failure_info_list, expected_exception=AssertionError)130 131 def test_empty_test_name(self):132 failure_info_list = [{"testName": "", "builderName": "Webkit Win", "failureTypeList": ["TEXT"]}]133 self.assert_update(failure_info_list, expected_exception=AssertionError)134 135 def test_unknown_failure_type(self):136 failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Webkit Win", "failureTypeList": ["IMAGE", "EXPLODE"]}]137 expectations_before = ""138 expectations_after = "\nBUG_NEW XP RELEASE : failures/expected/image.html = IMAGE"139 self.assert_update(failure_info_list, expectations_before=expectations_before, expectations_after=expectations_after)140 141 def test_add_new_expectation(self):142 failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Webkit Win", "failureTypeList": ["IMAGE"]}]143 expectations_before = ""144 expectations_after = "\nBUG_NEW XP RELEASE : failures/expected/image.html = IMAGE"145 self.assert_update(failure_info_list, expectations_before=expectations_before, expectations_after=expectations_after)146 147 def test_replace_old_expectation(self):148 failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Webkit Win", "failureTypeList": ["IMAGE"]}]149 expectations_before = "BUG_OLD XP RELEASE : failures/expected/image.html = TEXT"150 expectations_after = "BUG_NEW XP RELEASE : failures/expected/image.html = IMAGE"151 self.assert_update(failure_info_list, expectations_before=expectations_before, expectations_after=expectations_after)152 153 def test_pass_expectation(self):154 failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Webkit Win", "failureTypeList": ["PASS"]}]155 expectations_before = "BUG_OLD XP RELEASE : failures/expected/image.html = TEXT"156 expectations_after = ""157 self.assert_update(failure_info_list, expectations_before=expectations_before, expectations_after=expectations_after)158 159 def test_supplement_old_expectation(self):160 failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Webkit Win", "failureTypeList": ["IMAGE"]}]161 expectations_before = "BUG_OLD XP RELEASE : failures/expected/text.html = TEXT"162 expectations_after = ("BUG_OLD XP RELEASE : failures/expected/text.html = TEXT\n"163 "BUG_NEW XP RELEASE : failures/expected/image.html = IMAGE")164 self.assert_update(failure_info_list, expectations_before=expectations_before, expectations_after=expectations_after)165 166 def test_spurious_updates(self):167 failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Webkit Win", "failureTypeList": ["IMAGE"]}]168 expectations_before = "BUG_OLDER MAC LINUX : failures/expected/image.html = IMAGE+TEXT\nBUG_OLD XP RELEASE : failures/expected/image.html = TEXT"169 expectations_after = "BUG_OLDER MAC LINUX : failures/expected/image.html = IMAGE+TEXT\nBUG_NEW XP RELEASE : failures/expected/image.html = IMAGE"170 self.assert_update(failure_info_list, expectations_before=expectations_before, expectations_after=expectations_after)171 172 173 100 class GardeningServerTest(unittest.TestCase): 174 101 def _post_to_path(self, path, body=None, expected_stderr=None, expected_stdout=None, server=None): … … 204 131 expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n" 205 132 self._post_to_path("/rebaselineall", body='{"user-scripts/another-test.html":{"MOCK builder": ["txt","png"]}}', expected_stderr=expected_stderr, expected_stdout=expected_stdout) 206 207 def test_updateexpectations(self):208 expected_stderr = ""209 expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n"210 self._post_to_path("/updateexpectations", body="[]", expected_stderr=expected_stderr, expected_stdout=expected_stdout)
Note: See TracChangeset
for help on using the changeset viewer.