[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

abarth at webkit.org abarth at webkit.org
Thu Apr 8 01:20:39 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit e02a3a50cf8ce1dc448aff2634111ab2a73c5297
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jan 22 01:07:46 2010 +0000

    2010-01-21  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            Make the EWS transactional
            https://bugs.webkit.org/show_bug.cgi?id=33978
    
            Now if the EWS gets interrupted in the middle of processing a patch,
            the bots will re-process the patch.
    
            * Scripts/test-webkitpy:
            * Scripts/webkitpy/commands/queues.py:
            * Scripts/webkitpy/commands/queues_unittest.py:
            * Scripts/webkitpy/patchcollection.py:
            * Scripts/webkitpy/patchcollection_unittest.py: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53661 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 812cdde..5d99f46 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,5 +1,21 @@
 2010-01-21  Adam Barth  <abarth at webkit.org>
 
+        Reviewed by Eric Seidel.
+
+        Make the EWS transactional
+        https://bugs.webkit.org/show_bug.cgi?id=33978
+
+        Now if the EWS gets interrupted in the middle of processing a patch,
+        the bots will re-process the patch.
+
+        * Scripts/test-webkitpy:
+        * Scripts/webkitpy/commands/queues.py:
+        * Scripts/webkitpy/commands/queues_unittest.py:
+        * Scripts/webkitpy/patchcollection.py:
+        * Scripts/webkitpy/patchcollection_unittest.py: Added.
+
+2010-01-21  Adam Barth  <abarth at webkit.org>
+
         Unreviewed.  Add missing "ago" for style in the status bubble.
 
         * QueueStatusServer/templates/statusbubble.html:
diff --git a/WebKitTools/Scripts/test-webkitpy b/WebKitTools/Scripts/test-webkitpy
index 60a3ce8..eaccd58 100755
--- a/WebKitTools/Scripts/test-webkitpy
+++ b/WebKitTools/Scripts/test-webkitpy
@@ -44,6 +44,7 @@ from webkitpy.diff_parser_unittest import *
 from webkitpy.executive_unittest import *
 from webkitpy.multicommandtool_unittest import *
 from webkitpy.networktransaction_unittest import *
+from webkitpy.patchcollection_unittest import *
 from webkitpy.queueengine_unittest import *
 from webkitpy.steps.steps_unittest import *
 from webkitpy.steps.closebugforlanddiff_unittest import *
diff --git a/WebKitTools/Scripts/webkitpy/commands/queues.py b/WebKitTools/Scripts/webkitpy/commands/queues.py
index 350c1ea..a01f999 100644
--- a/WebKitTools/Scripts/webkitpy/commands/queues.py
+++ b/WebKitTools/Scripts/webkitpy/commands/queues.py
@@ -234,6 +234,9 @@ class AbstractReviewQueue(AbstractQueue, PersistentPatchCollectionDelegate, Step
     def status_server(self):
         return self.tool.status_server
 
+    def is_terminal_status(self, status):
+        return status == "Pass" or status == "Fail" or status.startswith("Error:")
+
     # AbstractQueue methods
 
     def begin_work_queue(self):
diff --git a/WebKitTools/Scripts/webkitpy/commands/queues_unittest.py b/WebKitTools/Scripts/webkitpy/commands/queues_unittest.py
index a422456..1aa5481 100644
--- a/WebKitTools/Scripts/webkitpy/commands/queues_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/commands/queues_unittest.py
@@ -40,6 +40,10 @@ class TestQueue(AbstractQueue):
     name = "test-queue"
 
 
+class TestReviewQueue(AbstractReviewQueue):
+    name = "test-review-queue"
+
+
 class AbstractQueueTest(CommandsTest):
     def _assert_log_progress_output(self, patch_ids, progress_output):
         OutputCapture().assert_outputs(self, TestQueue().log_progress, [patch_ids], expected_stderr=progress_output)
@@ -63,6 +67,20 @@ class AbstractQueueTest(CommandsTest):
         self._assert_run_webkit_patch(["one", 2])
 
 
+class AbstractReviewQueueTest(CommandsTest):
+    def test_patch_collection_delegate_methods(self):
+        queue = TestReviewQueue()
+        tool = MockBugzillaTool()
+        queue.bind_to_tool(tool)
+        self.assertEquals(queue.collection_name(), "test-review-queue")
+        self.assertEquals(queue.fetch_potential_patch_ids(), [103])
+        queue.status_server()
+        self.assertTrue(queue.is_terminal_status("Pass"))
+        self.assertTrue(queue.is_terminal_status("Fail"))
+        self.assertTrue(queue.is_terminal_status("Error: Your patch exploded"))
+        self.assertFalse(queue.is_terminal_status("Foo"))
+
+
 class CommitQueueTest(QueuesTest):
     def test_commit_queue(self):
         expected_stderr = {
diff --git a/WebKitTools/Scripts/webkitpy/patchcollection.py b/WebKitTools/Scripts/webkitpy/patchcollection.py
index 246f487..7e8603c 100644
--- a/WebKitTools/Scripts/webkitpy/patchcollection.py
+++ b/WebKitTools/Scripts/webkitpy/patchcollection.py
@@ -37,6 +37,9 @@ class PersistentPatchCollectionDelegate:
     def status_server(self):
         raise NotImplementedError, "subclasses must implement"
 
+    def is_terminal_status(self, status):
+        raise NotImplementedError, "subclasses must implement"
+
 
 class PersistentPatchCollection:
     def __init__(self, delegate):
@@ -50,7 +53,7 @@ class PersistentPatchCollection:
         if cached:
             return cached
         status = self._status.patch_status(self._name, patch_id)
-        if status:
+        if status and self._delegate.is_terminal_status(status):
             self._status_cache[patch_id] = status
         return status
 
@@ -58,6 +61,5 @@ class PersistentPatchCollection:
         patch_ids = self._delegate.fetch_potential_patch_ids()
         for patch_id in patch_ids:
             status = self._cached_status(patch_id)
-            if not status:
+            if not status or not self._delegate.is_terminal_status(status):
                 return patch_id
-
diff --git a/WebKitTools/Scripts/webkitpy/patchcollection_unittest.py b/WebKitTools/Scripts/webkitpy/patchcollection_unittest.py
new file mode 100644
index 0000000..811fed9
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/patchcollection_unittest.py
@@ -0,0 +1,53 @@
+#!/usr/bin/env python
+# Copyright (c) 2009, Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+# 
+#     * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#     * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+from webkitpy.mock import Mock
+from webkitpy.patchcollection import PersistentPatchCollection, PersistentPatchCollectionDelegate
+
+
+class TestPersistentPatchCollectionDelegate(PersistentPatchCollectionDelegate):
+    def collection_name(self):
+        return "test-collection"
+
+    def fetch_potential_patch_ids(self):
+        return [42, 192, 87]
+
+    def status_server(self):
+        return Mock()
+
+    def is_terminal_status(self, status):
+        return False
+
+
+class PersistentPatchCollectionTest(unittest.TestCase):
+    def test_next(self):
+        collection = PersistentPatchCollection(TestPersistentPatchCollectionDelegate())
+        collection.next()

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list