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

abarth at webkit.org abarth at webkit.org
Wed Dec 22 13:52:37 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 37641c469c3efd2ac97bec14d1ea6721560e722a
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Sep 28 19:14:45 2010 +0000

    2010-09-28  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            Introduce FailureMap to summaries the failures status of all the bots
            https://bugs.webkit.org/show_bug.cgi?id=46700
    
            This patch gives the SheriffBot a handle on the list of failing tests.
    
            * Scripts/webkitpy/common/net/buildbot.py:
            * Scripts/webkitpy/common/net/failuremap.py: Added.
            * Scripts/webkitpy/tool/commands/queries.py:
            * Scripts/webkitpy/tool/commands/sheriffbot.py:
            * Scripts/webkitpy/tool/mocktool.py:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68548 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 985c26f..5ba65fe 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,18 @@
+2010-09-28  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Introduce FailureMap to summaries the failures status of all the bots
+        https://bugs.webkit.org/show_bug.cgi?id=46700
+
+        This patch gives the SheriffBot a handle on the list of failing tests.
+
+        * Scripts/webkitpy/common/net/buildbot.py:
+        * Scripts/webkitpy/common/net/failuremap.py: Added.
+        * Scripts/webkitpy/tool/commands/queries.py:
+        * Scripts/webkitpy/tool/commands/sheriffbot.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+
 2010-09-28  Adam Roben  <aroben at apple.com>
 
         Update for the addition of WKPageUIClient::didNotHandleKeyEvent
diff --git a/WebKitTools/Scripts/webkitpy/common/net/buildbot.py b/WebKitTools/Scripts/webkitpy/common/net/buildbot.py
index 90e5e97..17f6c7a 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/buildbot.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/buildbot.py
@@ -34,6 +34,7 @@ import urllib
 import urllib2
 import xmlrpclib
 
+from webkitpy.common.net.failuremap import FailureMap
 from webkitpy.common.net.regressionwindow import RegressionWindow
 from webkitpy.common.system.logutils import get_logger
 from webkitpy.thirdparty.autoinstalled.mechanize import Browser
@@ -451,20 +452,17 @@ class BuildBot(object):
             self._builder_by_name[name] = builder
         return builder
 
-    def revisions_causing_failures(self, only_core_builders=True):
+    def failure_map(self, only_core_builders=True):
         builder_statuses = self.core_builder_statuses() if only_core_builders else self.builder_statuses()
+        failure_map = FailureMap()
         revision_to_failing_bots = {}
         for builder_status in builder_statuses:
             if builder_status["is_green"]:
                 continue
             builder = self.builder_with_name(builder_status["name"])
             regression_window = builder.find_blameworthy_regression_window(builder_status["build_number"])
-            revisions = regression_window.revisions() if regression_window else []
-            for revision in revisions:
-                failing_bots = revision_to_failing_bots.get(revision, [])
-                failing_bots.append(builder)
-                revision_to_failing_bots[revision] = failing_bots
-        return revision_to_failing_bots
+            failure_map.add_regression_window(builder, regression_window)
+        return failure_map
 
     # This makes fewer requests than calling Builder.latest_build would.  It grabs all builder
     # statuses in one request using self.builder_statuses (fetching /one_box_per_builder instead of builder pages).
diff --git a/WebKitTools/Scripts/webkitpy/common/net/failuremap.py b/WebKitTools/Scripts/webkitpy/common/net/failuremap.py
new file mode 100644
index 0000000..98e4b8f
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/failuremap.py
@@ -0,0 +1,48 @@
+# Copyright (C) 2010 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.
+
+
+class FailureMap(object):
+    def __init__(self):
+        self._failures = []
+
+    def add_regression_window(self, builder, regression_window):
+        self._failures.append({
+            'builder': builder,
+            'regression_window': regression_window,
+        })
+
+    def revisions_causing_failures(self):
+        revision_to_failing_bots = {}
+        for failure_info in self._failures:
+            revisions = failure_info['regression_window'].revisions()
+            for revision in revisions:
+                failing_bots = revision_to_failing_bots.get(revision, [])
+                failing_bots.append(failure_info['builder'])
+                revision_to_failing_bots[revision] = failing_bots
+        return revision_to_failing_bots
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queries.py b/WebKitTools/Scripts/webkitpy/tool/commands/queries.py
index 51c60b6..c6e45aa 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queries.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queries.py
@@ -167,7 +167,7 @@ class WhoBrokeIt(AbstractDeclarativeCommand):
     help_text = "Print a list of revisions causing failures on %s" % BuildBot.default_host
 
     def execute(self, options, args, tool):
-        for revision, builders in self._tool.buildbot.revisions_causing_failures(False).items():
+        for revision, builders in self._tool.buildbot.failure_map(False).revisions_causing_failures().items():
             print "r%s appears to have broken %s" % (revision, [builder.name() for builder in builders])
 
 
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot.py b/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot.py
index acbfa9a..23d013d 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot.py
@@ -86,7 +86,7 @@ class SheriffBot(AbstractQueue, StepSequenceErrorHandler):
         self._update()
 
         # We do one read from buildbot to ensure a consistent view.
-        revisions_causing_failures = self._tool.buildbot.revisions_causing_failures()
+        revisions_causing_failures = self._tool.buildbot.failure_map().revisions_causing_failures()
 
         # Similarly, we read once from our the status_server.
         old_failing_svn_revisions = []
diff --git a/WebKitTools/Scripts/webkitpy/tool/mocktool.py b/WebKitTools/Scripts/webkitpy/tool/mocktool.py
index 8a6188a..5084ed5 100644
--- a/WebKitTools/Scripts/webkitpy/tool/mocktool.py
+++ b/WebKitTools/Scripts/webkitpy/tool/mocktool.py
@@ -350,6 +350,16 @@ class MockBuilder(object):
             self._name, username, comments))
 
 
+class MockFailureMap():
+    def __init__(self, buildbot):
+        self._buildbot = buildbot
+
+    def revisions_causing_failures(self):
+        return {
+            "29837": [self._buildbot.builder_with_name("Builder1")],
+        }
+
+
 class MockBuildBot(object):
     buildbot_host = "dummy_buildbot_host"
     def __init__(self):
@@ -394,10 +404,8 @@ class MockBuildBot(object):
     def light_tree_on_fire(self):
         self._mock_builder2_status["is_green"] = False
 
-    def revisions_causing_failures(self):
-        return {
-            "29837": [self.builder_with_name("Builder1")],
-        }
+    def failure_map(self):
+        return MockFailureMap(self)
 
 
 class MockSCM(Mock):

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list