Title: [87107] trunk/Tools
Revision
87107
Author
[email protected]
Date
2011-05-23 16:52:03 -0700 (Mon, 23 May 2011)

Log Message

2011-05-23  Adam Barth  <[email protected]>

        Reviewed by Eric Seidel.

        sheriffbot should give more details about the failures in IRC
        https://bugs.webkit.org/show_bug.cgi?id=61233

        With this patch, sheriffbot will annonce the set of failing tests,
        which might help folks triage the problem.

        * Scripts/webkitpy/tool/commands/sheriffbot.py:
        * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (87106 => 87107)


--- trunk/Tools/ChangeLog	2011-05-23 23:50:21 UTC (rev 87106)
+++ trunk/Tools/ChangeLog	2011-05-23 23:52:03 UTC (rev 87107)
@@ -1,3 +1,16 @@
+2011-05-23  Adam Barth  <[email protected]>
+
+        Reviewed by Eric Seidel.
+
+        sheriffbot should give more details about the failures in IRC
+        https://bugs.webkit.org/show_bug.cgi?id=61233
+
+        With this patch, sheriffbot will annonce the set of failing tests,
+        which might help folks triage the problem.
+
+        * Scripts/webkitpy/tool/commands/sheriffbot.py:
+        * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
+
 2011-05-23  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r87078.

Modified: trunk/Tools/Scripts/webkitpy/common/net/failuremap.py (87106 => 87107)


--- trunk/Tools/Scripts/webkitpy/common/net/failuremap.py	2011-05-23 23:50:21 UTC (rev 87106)
+++ trunk/Tools/Scripts/webkitpy/common/net/failuremap.py	2011-05-23 23:52:03 UTC (rev 87107)
@@ -59,6 +59,9 @@
             result = result.union(test)
         return sorted(result)
 
+    def failing_tests(self):
+        return set(sum([self.tests_failing_for(revision) for revision in self.failing_revisions()], []))
+
     def _old_failures(self, is_old_failure):
         return filter(lambda revision: is_old_failure(revision),
                       self.failing_revisions())

Modified: trunk/Tools/Scripts/webkitpy/common/net/failuremap_unittest.py (87106 => 87107)


--- trunk/Tools/Scripts/webkitpy/common/net/failuremap_unittest.py	2011-05-23 23:50:21 UTC (rev 87106)
+++ trunk/Tools/Scripts/webkitpy/common/net/failuremap_unittest.py	2011-05-23 23:52:03 UTC (rev 87107)
@@ -74,3 +74,7 @@
     def test_tests_failing_for(self):
         failure_map = self._make_failure_map()
         self.assertEquals(failure_map.tests_failing_for(1234), [u'test1'])
+
+    def test_failing_tests(self):
+        failure_map = self._make_failure_map()
+        self.assertEquals(failure_map.failing_tests(), set([u'test1']))

Modified: trunk/Tools/Scripts/webkitpy/tool/bot/sheriff.py (87106 => 87107)


--- trunk/Tools/Scripts/webkitpy/tool/bot/sheriff.py	2011-05-23 23:50:21 UTC (rev 87106)
+++ trunk/Tools/Scripts/webkitpy/tool/bot/sheriff.py	2011-05-23 23:52:03 UTC (rev 87107)
@@ -51,6 +51,16 @@
 
         self._tool.irc().post(irc_message)
 
+    def post_irc_summary(self, failure_map):
+        failing_tests = failure_map.failing_tests()
+        if not failing_tests:
+            return
+        test_list_limit = 5
+        irc_message = "New failures: %s" % ", ".join(sorted(failing_tests)[:test_list_limit])
+        if len(failing_tests) > test_list_limit:
+            irc_message += " (and more...)"
+        self._tool.irc().post(irc_message)
+
     def post_rollout_patch(self, svn_revision_list, rollout_reason):
         # Ensure that svn revisions are numbers (and not options to
         # create-rollout).

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/sheriffbot.py (87106 => 87107)


--- trunk/Tools/Scripts/webkitpy/tool/commands/sheriffbot.py	2011-05-23 23:50:21 UTC (rev 87106)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/sheriffbot.py	2011-05-23 23:52:03 UTC (rev 87107)
@@ -81,7 +81,6 @@
         number_of_failing_revisions = len(failing_revisions)
         for revision in failing_revisions:
             builders = failure_map.builders_failing_for(revision)
-            tests = failure_map.tests_failing_for(revision)
             try:
                 commit_info = self._tool.checkout().commit_info_for_revision(revision)
                 if not commit_info:
@@ -92,6 +91,7 @@
             finally:
                 for builder in builders:
                     self._tool.status_server.update_svn_revision(revision, builder.name())
+        self._sheriff.post_irc_summary(failure_map)
         return True
 
     def handle_unexpected_error(self, failure_map, message):

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py (87106 => 87107)


--- trunk/Tools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py	2011-05-23 23:50:21 UTC (rev 87106)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py	2011-05-23 23:52:03 UTC (rev 87107)
@@ -44,7 +44,22 @@
             "begin_work_queue": self._default_begin_work_queue_stderr("sheriff-bot", tool.scm().checkout_root),
             "next_work_item": "",
             "process_work_item": """MOCK: irc.post: abarth, darin, eseidel: http://trac.webkit.org/changeset/29837 might have broken Builder1
+MOCK: irc.post: New failures: mock-test-1
 """,
-            "handle_unexpected_error": "Mock error message\n"
+            "handle_unexpected_error": "Mock error message\n",
         }
         self.assert_queue_outputs(SheriffBot(), work_item=mock_work_item, expected_stderr=expected_stderr)
+
+    def test_many_failing_tests(self):
+        tool = MockTool()
+        mock_work_item = MockFailureMap(tool.buildbot)
+        mock_work_item.failing_tests = lambda: set(["test1", "test2", "test3", "test4", "test5", "test6", "test7"])
+        expected_stderr = {
+            "begin_work_queue": self._default_begin_work_queue_stderr("sheriff-bot", tool.scm().checkout_root),
+            "next_work_item": "",
+            "process_work_item": """MOCK: irc.post: abarth, darin, eseidel: http://trac.webkit.org/changeset/29837 might have broken Builder1
+MOCK: irc.post: New failures: test1, test2, test3, test4, test5 (and more...)
+""",
+            "handle_unexpected_error": "Mock error message\n",
+        }
+        self.assert_queue_outputs(SheriffBot(), work_item=mock_work_item, expected_stderr=expected_stderr)

Modified: trunk/Tools/Scripts/webkitpy/tool/mocktool.py (87106 => 87107)


--- trunk/Tools/Scripts/webkitpy/tool/mocktool.py	2011-05-23 23:50:21 UTC (rev 87106)
+++ trunk/Tools/Scripts/webkitpy/tool/mocktool.py	2011-05-23 23:52:03 UTC (rev 87107)
@@ -412,7 +412,10 @@
     def tests_failing_for(self, revision):
         return ["mock-test-1"]
 
+    def failing_tests(self):
+        return set(["mock-test-1"])
 
+
 class MockBuildBot(object):
     buildbot_host = "dummy_buildbot_host"
     def __init__(self):
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to