Title: [119628] trunk/Tools
Revision
119628
Author
[email protected]
Date
2012-06-06 15:44:48 -0700 (Wed, 06 Jun 2012)

Log Message

get rebaselining tools to kinda work with the skia overrides file
https://bugs.webkit.org/show_bug.cgi?id=88456

Reviewed by Ryosuke Niwa.

Update rebaseline-expectations so that we read in the overrides
when looking for tests to rebaseline, but don't read in the
overrides when we are writing the expectations file back out.
This prevents the overrides from getting written into the main
file. This is kind of a hack but will have to do until we
support multiple expectations files properly.

* Scripts/webkitpy/tool/commands/rebaseline.py:
(RebaselineExpectations._expectations):
(RebaselineExpectations._update_expectations_file):
(RebaselineExpectations._tests_to_rebaseline):
* Scripts/webkitpy/tool/commands/rebaseline_unittest.py:
(test_overrides_are_included_correctly):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (119627 => 119628)


--- trunk/Tools/ChangeLog	2012-06-06 22:44:27 UTC (rev 119627)
+++ trunk/Tools/ChangeLog	2012-06-06 22:44:48 UTC (rev 119628)
@@ -1,5 +1,26 @@
 2012-06-06  Dirk Pranke  <[email protected]>
 
+        get rebaselining tools to kinda work with the skia overrides file
+        https://bugs.webkit.org/show_bug.cgi?id=88456
+
+        Reviewed by Ryosuke Niwa.
+
+        Update rebaseline-expectations so that we read in the overrides
+        when looking for tests to rebaseline, but don't read in the
+        overrides when we are writing the expectations file back out.
+        This prevents the overrides from getting written into the main
+        file. This is kind of a hack but will have to do until we
+        support multiple expectations files properly.
+
+        * Scripts/webkitpy/tool/commands/rebaseline.py:
+        (RebaselineExpectations._expectations):
+        (RebaselineExpectations._update_expectations_file):
+        (RebaselineExpectations._tests_to_rebaseline):
+        * Scripts/webkitpy/tool/commands/rebaseline_unittest.py:
+        (test_overrides_are_included_correctly):
+
+2012-06-06  Dirk Pranke  <[email protected]>
+
         webkitpy: two manager_worker_broker_unittest tests are broken
         https://bugs.webkit.org/show_bug.cgi?id=88445
 

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline.py (119627 => 119628)


--- trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline.py	2012-06-06 22:44:27 UTC (rev 119627)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline.py	2012-06-06 22:44:48 UTC (rev 119628)
@@ -260,19 +260,24 @@
         # FIXME: Support non-Chromium ports.
         return port_name.startswith('chromium-')
 
-    def _expectations(self, port):
-        return TestExpectations(port)
+    def _expectations(self, port, include_overrides):
+        return TestExpectations(port, include_overrides=include_overrides)
 
     def _update_expectations_file(self, port_name):
         if not self._is_supported_port(port_name):
             return
         port = self._tool.port_factory.get(port_name)
-        expectations = self._expectations(port)
+
+        # FIXME: This will intentionally skip over any REBASELINE expectations that were in an overrides file.
+        # This is not good, but avoids having the overrides getting written into the main file.
+        # See https://bugs.webkit.org/show_bug.cgi?id=88456 for context. This will no longer be needed
+        # once we properly support cascading expectations files.
+        expectations = self._expectations(port, include_overrides=False)
         path = port.path_to_test_expectations_file()
         self._tool.filesystem.write_text_file(path, expectations.remove_rebaselined_tests(expectations.get_rebaselining_failures()))
 
     def _tests_to_rebaseline(self, port):
-        return self._expectations(port).get_rebaselining_failures()
+        return self._expectations(port, include_overrides=True).get_rebaselining_failures()
 
     def _rebaseline_port(self, port_name):
         if not self._is_supported_port(port_name):

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py (119627 => 119628)


--- trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py	2012-06-06 22:44:27 UTC (rev 119627)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py	2012-06-06 22:44:48 UTC (rev 119628)
@@ -240,3 +240,20 @@
 
         command._tests_to_rebaseline = lambda port: ['userscripts/another-test.html', 'userscripts/images.svg']
         OutputCapture().assert_outputs(self, command.execute, [MockOptions(optimize=True), [], tool], expected_logs=expected_logs_with_optimize, expected_stderr=expected_stderr_with_optimize)
+
+    def test_overrides_are_included_correctly(self):
+        command = RebaselineExpectations()
+        tool = MockTool()
+        command.bind_to_tool(tool)
+        port = tool.port_factory.get('chromium-mac-lion')
+
+        # This tests that the any tests marked as REBASELINE in the overrides are found, but
+        # that the overrides do not get written into the main file.
+        self.overrides = ('BUGX REBASELINE : userscripts/another-test.html = TEXT\n'
+                          'BUGY : userscripts/test.html = CRASH\n')
+
+        port._filesystem.write_text_file(port.path_to_test_expectations_file(), '')
+        port._filesystem.write_text_file(port.layout_tests_dir() + '/userscripts/another-test.html', '')
+        port.test_expectations_overrides = lambda: self.overrides
+        self.assertEquals(command._tests_to_rebaseline(port), set(['userscripts/another-test.html']))
+        self.assertEquals(port._filesystem.read_text_file(port.path_to_test_expectations_file()), '')
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to