Title: [120247] trunk/Tools
Revision
120247
Author
[email protected]
Date
2012-06-13 14:07:05 -0700 (Wed, 13 Jun 2012)

Log Message

nrwt: remove port.test_expectations() and port.test_expectations_overrides()
https://bugs.webkit.org/show_bug.cgi?id=88948

Reviewed by Ojan Vafai.

In the final patch of this run, we remove the
test_expectations() and test_expectation_overrides() methods
from the Port class - callers must now use just
expectations_dict().

Note that support for the cascade in new-run-webkit-tests is
complete but only Chromium uses it; webkit-patch
rebaseline-expectations still does not support updating entries
in any file other than the first expectations file, however.

* Scripts/webkitpy/layout_tests/port/base.py:
(Port.path_to_test_expectations_file):
(Port.uses_test_expectations_file):
(Port.expectations_files):
* Scripts/webkitpy/layout_tests/port/base_unittest.py:
(PortTest.test_additional_expectations):
* Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
(ChromiumPortTest.test_expectations_files):
* Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py:
(TestGoogleChromePort.test_get_google_chrome_port):
* Scripts/webkitpy/layout_tests/port/webkit_unittest.py:
(test_test_expectations):
(test_legacy_test_expectations):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (120246 => 120247)


--- trunk/Tools/ChangeLog	2012-06-13 21:01:19 UTC (rev 120246)
+++ trunk/Tools/ChangeLog	2012-06-13 21:07:05 UTC (rev 120247)
@@ -1,5 +1,36 @@
 2012-06-13  Dirk Pranke  <[email protected]>
 
+        nrwt: remove port.test_expectations() and port.test_expectations_overrides()
+        https://bugs.webkit.org/show_bug.cgi?id=88948
+
+        Reviewed by Ojan Vafai.
+
+        In the final patch of this run, we remove the
+        test_expectations() and test_expectation_overrides() methods
+        from the Port class - callers must now use just
+        expectations_dict().
+
+        Note that support for the cascade in new-run-webkit-tests is
+        complete but only Chromium uses it; webkit-patch
+        rebaseline-expectations still does not support updating entries
+        in any file other than the first expectations file, however.
+
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        (Port.path_to_test_expectations_file):
+        (Port.uses_test_expectations_file):
+        (Port.expectations_files):
+        * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+        (PortTest.test_additional_expectations):
+        * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
+        (ChromiumPortTest.test_expectations_files):
+        * Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py:
+        (TestGoogleChromePort.test_get_google_chrome_port):
+        * Scripts/webkitpy/layout_tests/port/webkit_unittest.py:
+        (test_test_expectations):
+        (test_legacy_test_expectations):
+
+2012-06-13  Dirk Pranke  <[email protected]>
+
         nrwt: implement the actual cascade of TestExpectations
         https://bugs.webkit.org/show_bug.cgi?id=88947
 

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py (120246 => 120247)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py	2012-06-13 21:01:19 UTC (rev 120246)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py	2012-06-13 21:07:05 UTC (rev 120247)
@@ -689,6 +689,8 @@
         This is used by the rebaselining tool. Raises NotImplementedError
         if the port does not use expectations files."""
 
+        # FIXME: We need to remove this when we make rebaselining work with multiple files and just generalize expectations_files().
+
         # test_expectations are always in mac/ not mac-leopard/ by convention, hence we use port_name instead of name().
         port_name = self.port_name
         if port_name.startswith('chromium') or port_name.startswith('google-chrome'):
@@ -919,28 +921,9 @@
         return expectations
 
     def expectations_files(self):
+        # FIXME: see comment in path_to_expectations_file().
         return [self.path_to_test_expectations_file()]
 
-    def test_expectations(self):
-        """Returns the test expectations for this port.
-
-        Basically this string should contain the equivalent of a
-        test_expectations file. See test_expectations.py for more details."""
-        # FIXME: remove this when the cascade works fully.
-        return self.expectations_dict().values()[0]
-
-    def test_expectations_overrides(self):
-        """Returns an optional set of overrides for the test_expectations.
-
-        This is used by ports that have code in two repositories, and where
-        it is possible that you might need "downstream" expectations that
-        temporarily override the "upstream" expectations until the port can
-        sync up the two repos."""
-        # FIXME: remove this when the cascade works fully.
-        if len(self.expectations_dict()) > 1:
-            return ''.join(self.expectations_dict().values()[1:])
-        return None
-
     def repository_paths(self):
         """Returns a list of (repository_name, repository_path) tuples of its depending code base.
         By default it returns a list that only contains a ('webkit', <webkitRepossitoryPath>) tuple."""

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py (120246 => 120247)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py	2012-06-13 21:01:19 UTC (rev 120246)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py	2012-06-13 21:07:05 UTC (rev 120247)
@@ -282,25 +282,24 @@
         port = self.make_port(port_name='foo')
         port.port_name = 'foo'
         port._filesystem.write_text_file('/mock-checkout/LayoutTests/platform/foo/TestExpectations', '')
-
         port._filesystem.write_text_file(
             '/tmp/additional-expectations-1.txt', 'content1\n')
         port._filesystem.write_text_file(
             '/tmp/additional-expectations-2.txt', 'content2\n')
 
-        self.assertEquals(None, port.test_expectations_overrides())
+        self.assertEquals('\n'.join(port.expectations_dict().values()), '')
 
         port._options.additional_expectations = [
             '/tmp/additional-expectations-1.txt']
-        self.assertEquals('content1\n', port.test_expectations_overrides())
+        self.assertEquals('\n'.join(port.expectations_dict().values()), '\ncontent1\n')
 
         port._options.additional_expectations = [
             '/tmp/nonexistent-file', '/tmp/additional-expectations-1.txt']
-        self.assertEquals('content1\n', port.test_expectations_overrides())
+        self.assertEquals('\n'.join(port.expectations_dict().values()), '\ncontent1\n')
 
         port._options.additional_expectations = [
             '/tmp/additional-expectations-1.txt', '/tmp/additional-expectations-2.txt']
-        self.assertEquals('content1\ncontent2\n', port.test_expectations_overrides())
+        self.assertEquals('\n'.join(port.expectations_dict().values()), '\ncontent1\n\ncontent2\n')
 
     def test_uses_test_expectations_file(self):
         port = self.make_port(port_name='foo')

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py (120246 => 120247)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py	2012-06-13 21:01:19 UTC (rev 120246)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py	2012-06-13 21:07:05 UTC (rev 120247)
@@ -292,55 +292,26 @@
             exception_raised = True
         self.assertFalse(exception_raised)
 
-    def test_overrides_and_builder_names(self):
+    def test_expectations_files(self):
         port = self.make_port()
         port.port_name = 'chromium'
 
-        filesystem = MockFileSystem()
-        filesystem.write_text_file('/mock-checkout/LayoutTests/platform/chromium/TestExpectations', '')
-
-        port._filesystem = filesystem
-        port.path_from_chromium_base = lambda *comps: '/' + '/'.join(comps)
-
+        expectations_path = port.path_to_test_expectations_file()
         chromium_overrides_path = port.path_from_chromium_base(
             'webkit', 'tools', 'layout_tests', 'test_expectations.txt')
-        CHROMIUM_OVERRIDES = 'contents of %s\n' % chromium_overrides_path
-        filesystem.write_text_file(chromium_overrides_path, CHROMIUM_OVERRIDES)
         skia_overrides_path = port.path_from_chromium_base(
             'skia', 'skia_test_expectations.txt')
-        SKIA_OVERRIDES = 'contents of %s\n' % skia_overrides_path
-        filesystem.write_text_file(skia_overrides_path, SKIA_OVERRIDES)
 
-        additional_expectations_path = port.path_from_chromium_base(
-            'additional_expectations.txt')
-        ADDITIONAL_EXPECTATIONS = 'contents of %s\n' % additional_expectations_path
-        filesystem.write_text_file(additional_expectations_path, ADDITIONAL_EXPECTATIONS)
-
         port._options.builder_name = 'DUMMY_BUILDER_NAME'
-        port._options.additional_expectations = []
-        self.assertEquals(port.test_expectations_overrides(),
-                          SKIA_OVERRIDES + CHROMIUM_OVERRIDES)
-        port._options.additional_expectations = [additional_expectations_path]
-        self.assertEquals(port.test_expectations_overrides(),
-                          SKIA_OVERRIDES + CHROMIUM_OVERRIDES + ADDITIONAL_EXPECTATIONS)
+        self.assertEquals(port.expectations_files(), [expectations_path, skia_overrides_path, chromium_overrides_path])
 
         port._options.builder_name = 'builder (deps)'
-        port._options.additional_expectations = []
-        self.assertEquals(port.test_expectations_overrides(),
-                          SKIA_OVERRIDES + CHROMIUM_OVERRIDES)
-        port._options.additional_expectations = [additional_expectations_path]
-        self.assertEquals(port.test_expectations_overrides(),
-                          SKIA_OVERRIDES + CHROMIUM_OVERRIDES + ADDITIONAL_EXPECTATIONS)
+        self.assertEquals(port.expectations_files(), [expectations_path, skia_overrides_path, chromium_overrides_path])
 
         # A builder which does NOT observe the Chromium test_expectations,
         # but still observes the Skia test_expectations...
         port._options.builder_name = 'builder'
-        port._options.additional_expectations = []
-        self.assertEquals(port.test_expectations_overrides(),
-                          SKIA_OVERRIDES)
-        port._options.additional_expectations = [additional_expectations_path]
-        self.assertEquals(port.test_expectations_overrides(),
-                          SKIA_OVERRIDES + ADDITIONAL_EXPECTATIONS)
+        self.assertEquals(port.expectations_files(), [expectations_path, skia_overrides_path])
 
     def test_expectations_ordering(self):
         # since we don't implement self.port_name in ChromiumPort.

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py (120246 => 120247)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py	2012-06-13 21:01:19 UTC (rev 120246)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py	2012-06-13 21:07:05 UTC (rev 120247)
@@ -54,11 +54,6 @@
         self._verify_expectations_overrides('google-chrome-linux32')
         self._verify_expectations_overrides('google-chrome-linux64')
 
-    def test_path_to_expectations(self):
-        port_factory = PortFactory(MockSystemHost())
-        for port_name in ('google-chrome-linux32', 'google-chrome-linux64', 'google-chrome-mac', 'google-chrome-win'):
-            self.assertTrue(port_factory.get(port_name).path_to_test_expectations_file().endswith('platform/chromium/TestExpectations'))
 
-
 if __name__ == '__main__':
     unittest.main()

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py (120246 => 120247)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py	2012-06-13 21:01:19 UTC (rev 120246)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py	2012-06-13 21:07:05 UTC (rev 120247)
@@ -175,7 +175,7 @@
         host.filesystem.write_text_file('/mock-checkout/LayoutTests/platform/testwebkitport/TestExpectations',
             'BUG_TESTEXPECTATIONS SKIP : fast/html/article-element.html = FAIL\n')
         port = TestWebKitPort(host=host)
-        self.assertEqual(port.test_expectations(), 'BUG_TESTEXPECTATIONS SKIP : fast/html/article-element.html = FAIL\n')
+        self.assertEqual(''.join(port.expectations_dict().values()), 'BUG_TESTEXPECTATIONS SKIP : fast/html/article-element.html = FAIL\n')
 
     def test_legacy_test_expectations(self):
         # Check that we read the legacy test_expectations.txt file
@@ -185,7 +185,7 @@
         host.filesystem.write_text_file('/mock-checkout/LayoutTests/platform/testwebkitport/TestExpectations',
             'BUG_BADEXPECTATION SKIP : fast/html/article-element.html = FAIL\n')
         port = TestWebKitPort(host=host)
-        self.assertEqual(port.test_expectations(), 'BUG_TESTEXPECTATIONS SKIP : fast/html/article-element.html = FAIL\n')
+        self.assertEqual(''.join(port.expectations_dict().values()), 'BUG_TESTEXPECTATIONS SKIP : fast/html/article-element.html = FAIL\n')
 
     def test_build_driver(self):
         output = OutputCapture()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to