Changeset 53661 in webkit
- Timestamp:
- Jan 21, 2010 5:07:46 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 5 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r53658 r53661 1 2010-01-21 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Make the EWS transactional 6 https://bugs.webkit.org/show_bug.cgi?id=33978 7 8 Now if the EWS gets interrupted in the middle of processing a patch, 9 the bots will re-process the patch. 10 11 * Scripts/test-webkitpy: 12 * Scripts/webkitpy/commands/queues.py: 13 * Scripts/webkitpy/commands/queues_unittest.py: 14 * Scripts/webkitpy/patchcollection.py: 15 * Scripts/webkitpy/patchcollection_unittest.py: Added. 16 1 17 2010-01-21 Adam Barth <abarth@webkit.org> 2 18 -
trunk/WebKitTools/Scripts/test-webkitpy
r53217 r53661 45 45 from webkitpy.multicommandtool_unittest import * 46 46 from webkitpy.networktransaction_unittest import * 47 from webkitpy.patchcollection_unittest import * 47 48 from webkitpy.queueengine_unittest import * 48 49 from webkitpy.steps.steps_unittest import * -
trunk/WebKitTools/Scripts/webkitpy/commands/queues.py
r53609 r53661 235 235 return self.tool.status_server 236 236 237 def is_terminal_status(self, status): 238 return status == "Pass" or status == "Fail" or status.startswith("Error:") 239 237 240 # AbstractQueue methods 238 241 -
trunk/WebKitTools/Scripts/webkitpy/commands/queues_unittest.py
r53298 r53661 41 41 42 42 43 class TestReviewQueue(AbstractReviewQueue): 44 name = "test-review-queue" 45 46 43 47 class AbstractQueueTest(CommandsTest): 44 48 def _assert_log_progress_output(self, patch_ids, progress_output): … … 64 68 65 69 70 class AbstractReviewQueueTest(CommandsTest): 71 def test_patch_collection_delegate_methods(self): 72 queue = TestReviewQueue() 73 tool = MockBugzillaTool() 74 queue.bind_to_tool(tool) 75 self.assertEquals(queue.collection_name(), "test-review-queue") 76 self.assertEquals(queue.fetch_potential_patch_ids(), [103]) 77 queue.status_server() 78 self.assertTrue(queue.is_terminal_status("Pass")) 79 self.assertTrue(queue.is_terminal_status("Fail")) 80 self.assertTrue(queue.is_terminal_status("Error: Your patch exploded")) 81 self.assertFalse(queue.is_terminal_status("Foo")) 82 83 66 84 class CommitQueueTest(QueuesTest): 67 85 def test_commit_queue(self): -
trunk/WebKitTools/Scripts/webkitpy/patchcollection.py
r52430 r53661 38 38 raise NotImplementedError, "subclasses must implement" 39 39 40 def is_terminal_status(self, status): 41 raise NotImplementedError, "subclasses must implement" 42 40 43 41 44 class PersistentPatchCollection: … … 51 54 return cached 52 55 status = self._status.patch_status(self._name, patch_id) 53 if status :56 if status and self._delegate.is_terminal_status(status): 54 57 self._status_cache[patch_id] = status 55 58 return status … … 59 62 for patch_id in patch_ids: 60 63 status = self._cached_status(patch_id) 61 if not status :64 if not status or not self._delegate.is_terminal_status(status): 62 65 return patch_id 63 -
trunk/WebKitTools/Scripts/webkitpy/patchcollection_unittest.py
r53658 r53661 28 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 29 30 class PersistentPatchCollectionDelegate: 30 import unittest 31 32 from webkitpy.mock import Mock 33 from webkitpy.patchcollection import PersistentPatchCollection, PersistentPatchCollectionDelegate 34 35 36 class TestPersistentPatchCollectionDelegate(PersistentPatchCollectionDelegate): 31 37 def collection_name(self): 32 r aise NotImplementedError, "subclasses must implement"38 return "test-collection" 33 39 34 40 def fetch_potential_patch_ids(self): 35 r aise NotImplementedError, "subclasses must implement"41 return [42, 192, 87] 36 42 37 43 def status_server(self): 38 raise NotImplementedError, "subclasses must implement" 44 return Mock() 45 46 def is_terminal_status(self, status): 47 return False 39 48 40 49 41 class PersistentPatchCollection: 42 def __init__(self, delegate): 43 self._delegate = delegate 44 self._name = self._delegate.collection_name() 45 self._status = self._delegate.status_server() 46 self._status_cache = {} 47 48 def _cached_status(self, patch_id): 49 cached = self._status_cache.get(patch_id) 50 if cached: 51 return cached 52 status = self._status.patch_status(self._name, patch_id) 53 if status: 54 self._status_cache[patch_id] = status 55 return status 56 57 def next(self): 58 patch_ids = self._delegate.fetch_potential_patch_ids() 59 for patch_id in patch_ids: 60 status = self._cached_status(patch_id) 61 if not status: 62 return patch_id 63 50 class PersistentPatchCollectionTest(unittest.TestCase): 51 def test_next(self): 52 collection = PersistentPatchCollection(TestPersistentPatchCollectionDelegate()) 53 collection.next()
Note: See TracChangeset
for help on using the changeset viewer.