[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

tony at chromium.org tony at chromium.org
Wed Dec 22 13:14:34 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 1c6c1348e3f00da2ef118057b3f7a4118b18eca3
Author: tony at chromium.org <tony at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 9 17:10:35 2010 +0000

    2010-08-25  Tony Chang  <tony at chromium.org>
    
            Reviewed by Ojan Vafai.
    
            don't delete duplicates needed because of intermediate results
            https://bugs.webkit.org/show_bug.cgi?id=44653
    
            Also, output the full path so we can pipe the output to rm.
    
            * Scripts/webkitpy/layout_tests/deduplicate_tests.py:
            * Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67092 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index a46b723..54bee93 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,15 @@
+2010-08-25  Tony Chang  <tony at chromium.org>
+
+        Reviewed by Ojan Vafai.
+
+        don't delete duplicates needed because of intermediate results
+        https://bugs.webkit.org/show_bug.cgi?id=44653
+
+        Also, output the full path so we can pipe the output to rm.
+
+        * Scripts/webkitpy/layout_tests/deduplicate_tests.py:
+        * Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py:
+
 2010-09-09  Balazs Kelemen  <kb at inf.u-szeged.hu>
 
         Reviewed by Andreas Kling.
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests.py b/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests.py
index bb63f5e..c543d91 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests.py
@@ -130,6 +130,32 @@ def extract_platforms(paths):
     return platforms
 
 
+def has_intermediate_results(test, fallbacks, matching_platform,
+                             path_exists=os.path.exists):
+    """Returns True if there is a test result that causes us to not delete
+    this duplicate.
+
+    For example, chromium-linux may be a duplicate of the checked in result,
+    but chromium-win may have a different result checked in.  In this case,
+    we need to keep the duplicate results.
+
+    Args:
+        test: The test name.
+        fallbacks: A list of platforms we fall back on.
+        matching_platform: The platform that we found the duplicate test
+            result.  We can stop checking here.
+        path_exists: Optional parameter that allows us to stub out
+            os.path.exists for testing.
+    """
+    for platform in fallbacks:
+        if platform == matching_platform:
+            return False
+        test_path = os.path.join('LayoutTests', 'platform', platform, test)
+        if path_exists(test_path):
+            return True
+    return False
+
+
 def find_dups(hashes, port_fallbacks):
     """Yields info about redundant test expectations.
     Args:
@@ -151,7 +177,12 @@ def find_dups(hashes, port_fallbacks):
         for platform in platforms.keys():
             for fallback in port_fallbacks[platform]:
                 if fallback in platforms.keys():
-                    yield test, platform, fallback, platforms[platform]
+                    # We have to verify that there isn't an intermediate result
+                    # that causes this duplicate hash to exist.
+                    if not has_intermediate_results(test,
+                            port_fallbacks[platform], fallback):
+                        path = os.path.join('LayoutTests', platforms[platform])
+                        yield test, platform, fallback, path
 
 
 def deduplicate(glob_pattern):
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py
index 66dda32..be2e381 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py
@@ -89,6 +89,47 @@ class ListDuplicatesTest(unittest.TestCase):
                            deduplicate_tests._BASE_PLATFORM: 'what/'},
                            deduplicate_tests.extract_platforms(['platform/foo/bar', 'what/']))
 
+    def test_has_intermediate_results(self):
+        test_cases = (
+            # If we found a duplicate in our first fallback, we have no
+            # intermediate results.
+            (False, ('fast/foo-expected.txt',
+                     ['chromium-win', 'chromium', 'base'],
+                     'chromium-win',
+                     lambda path: True)),
+            # Since chromium-win has a result, we have an intermediate result.
+            (True,  ('fast/foo-expected.txt',
+                     ['chromium-win', 'chromium', 'base'],
+                     'chromium',
+                     lambda path: True)),
+            # There are no intermediate results.
+            (False, ('fast/foo-expected.txt',
+                     ['chromium-win', 'chromium', 'base'],
+                     'chromium',
+                     lambda path: False)),
+            # There are no intermediate results since a result for chromium is
+            # our duplicate file.
+            (False, ('fast/foo-expected.txt',
+                     ['chromium-win', 'chromium', 'base'],
+                     'chromium',
+                     lambda path: path == 'LayoutTests/platform/chromium/fast/foo-expected.txt')),
+            # We have an intermediate result in 'chromium' even though our
+            # duplicate is with the file in 'base'.
+            (True,  ('fast/foo-expected.txt',
+                     ['chromium-win', 'chromium', 'base'],
+                     'base',
+                     lambda path: path == 'LayoutTests/platform/chromium/fast/foo-expected.txt')),
+            # We have an intermediate result in 'chromium-win' even though our
+            # duplicate is in 'base'.
+            (True,  ('fast/foo-expected.txt',
+                     ['chromium-win', 'chromium', 'base'],
+                     'base',
+                     lambda path: path == 'LayoutTests/platform/chromium-win/fast/foo-expected.txt')),
+        )
+        for expected, inputs in test_cases:
+            self.assertEquals(expected,
+                deduplicate_tests.has_intermediate_results(*inputs))
+
     def test_unique(self):
         MockExecutive.response = (
             '100644 blob 5053240b3353f6eb39f7cb00259785f16d121df2\tLayoutTests/mac/foo-expected.txt\n'
@@ -116,12 +157,12 @@ class ListDuplicatesTest(unittest.TestCase):
         self.assertEquals(('git', 'ls-tree', '-r', 'HEAD', 'LayoutTests'), MockExecutive.last_run_command[-1])
         self.assertEquals(2, len(result))
         self.assertEquals({'test': 'animage.png',
-                           'path': 'platform/chromium-linux/animage.png',
+                           'path': 'LayoutTests/platform/chromium-linux/animage.png',
                            'fallback': 'chromium-win',
                            'platform': 'chromium-linux'},
                           result[0])
         self.assertEquals({'test': 'foo-expected.txt',
-                           'path': 'platform/chromium-linux/foo-expected.txt',
+                           'path': 'LayoutTests/platform/chromium-linux/foo-expected.txt',
                            'fallback': 'chromium-win',
                            'platform': 'chromium-linux'},
                           result[1])
@@ -131,7 +172,7 @@ class ListDuplicatesTest(unittest.TestCase):
         self.assertEquals(('git', 'ls-tree', '-r', 'HEAD', 'LayoutTests'), MockExecutive.last_run_command[-1])
         self.assertEquals(1, len(result))
         self.assertEquals({'test': 'foo-expected.txt',
-                           'path': 'platform/chromium-linux/foo-expected.txt',
+                           'path': 'LayoutTests/platform/chromium-linux/foo-expected.txt',
                            'fallback': 'chromium-win',
                            'platform': 'chromium-linux'},
                           result[0])
@@ -141,7 +182,7 @@ class ListDuplicatesTest(unittest.TestCase):
         self.assertEquals(('git', 'ls-tree', '-r', 'HEAD', 'LayoutTests'), MockExecutive.last_run_command[-1])
         self.assertEquals(1, len(result))
         self.assertEquals({'test': 'animage.png',
-                           'path': 'platform/chromium-linux/animage.png',
+                           'path': 'LayoutTests/platform/chromium-linux/animage.png',
                            'fallback': 'chromium-win',
                            'platform': 'chromium-linux'},
                           result[0])

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list