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

eric at webkit.org eric at webkit.org
Wed Dec 22 18:25:58 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit c91e49706a5c05d9360d2ab15c12916c2914dd9f
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Dec 10 21:42:04 2010 +0000

    2010-12-10  Eric Seidel  <eric at webkit.org>
    
            Reviewed by Tony Chang.
    
            commit-queue should report port/platform information when commenting on flaky test bugs
            https://bugs.webkit.org/show_bug.cgi?id=50839
    
            This was a suggestion from Tony Chang this morning.
            I added a platform.py class so I could easily mock the platform call,
            but that may not be the final solution for this mocking.
            We'll try it and see.
    
            * Scripts/webkitpy/common/system/platform.py: Added.
            * Scripts/webkitpy/tool/bot/flakytestreporter.py:
            * Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py:
            * Scripts/webkitpy/tool/commands/queues_unittest.py:
            * Scripts/webkitpy/tool/main.py:
            * Scripts/webkitpy/tool/mocktool.py:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73798 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index a86e7ab..29562f4 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,22 @@
+2010-12-10  Eric Seidel  <eric at webkit.org>
+
+        Reviewed by Tony Chang.
+
+        commit-queue should report port/platform information when commenting on flaky test bugs
+        https://bugs.webkit.org/show_bug.cgi?id=50839
+
+        This was a suggestion from Tony Chang this morning.
+        I added a platform.py class so I could easily mock the platform call,
+        but that may not be the final solution for this mocking.
+        We'll try it and see.
+
+        * Scripts/webkitpy/common/system/platform.py: Added.
+        * Scripts/webkitpy/tool/bot/flakytestreporter.py:
+        * Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py:
+        * Scripts/webkitpy/tool/commands/queues_unittest.py:
+        * Scripts/webkitpy/tool/main.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+
 2010-12-10  Krithigassree Sambamurthy  <krithigassree.sambamurthy at nokia.com>
 
         Reviewed by Joseph Pecoraro.
diff --git a/WebKitTools/Scripts/webkitpy/common/system/platform.py b/WebKitTools/Scripts/webkitpy/common/system/platform.py
new file mode 100644
index 0000000..8139aed
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/platform.py
@@ -0,0 +1,39 @@
+# 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.
+
+import platform
+
+
+# We use this instead of calls to platform directly so allow mocking.
+# It's unclear if we should allow instantiation of multiple of these
+# objects (like we do Ports for rebaseline commands, etc.),
+# or if it should just be a mocking layer for python's platform.py
+class Platform(object):
+
+    def display_name(self):
+        return platform.platform(aliased=1, terse=1)
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/flakytestreporter.py b/WebKitTools/Scripts/webkitpy/tool/bot/flakytestreporter.py
index 8737a72..81d8a6e 100644
--- a/WebKitTools/Scripts/webkitpy/tool/bot/flakytestreporter.py
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/flakytestreporter.py
@@ -27,6 +27,7 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 import logging
+import platform
 
 from webkitpy.common.net.layouttestresults import path_for_layout_test, LayoutTestResults
 from webkitpy.common.config import urls
@@ -96,11 +97,20 @@ If you would like to track this test fix with another bug, please close this bug
         authors_string = join_with_separators(sorted(author_emails))
         return " (%s: %s)" % (heading_string, authors_string)
 
+    def _bot_information(self):
+        bot_id = self._tool.status_server.bot_id
+        bot_id_string = "Bot Id: %s " % (bot_id) if bot_id else ""
+        return "%sPort: %s OS: %s" % (bot_id_string, self._tool.port().name(), self._tool.platform.display_name())
+
+    def _latest_flake_message(self, flaky_test, patch):
+        flake_message = "The %s just saw %s flake while processing attachment %s on bug %s." % (self._bot_name, flaky_test, patch.id(), patch.bug_id())
+        return "%s\n%s" % (flake_message, self._bot_information())
+
     def report_flaky_tests(self, flaky_tests, patch):
         message = "The %s encountered the following flaky tests while processing attachment %s:\n\n" % (self._bot_name, patch.id())
         for flaky_test in flaky_tests:
             bug = self._lookup_bug_for_flaky_test(flaky_test)
-            latest_flake_message = "The %s just saw %s flake while processing attachment %s on bug %s." % (self._bot_name, flaky_test, patch.id(), patch.bug_id())
+            latest_flake_message = self._latest_flake_message(flaky_test, patch)
             author_emails = self._author_emails_for_test(flaky_test)
             if not bug:
                 self._create_bug_for_flaky_test(flaky_test, author_emails, latest_flake_message)
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py b/WebKitTools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py
index 6683c30..51ef626 100644
--- a/WebKitTools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py
@@ -31,7 +31,7 @@ import unittest
 from webkitpy.common.config.committers import Committer
 from webkitpy.common.system.outputcapture import OutputCapture
 from webkitpy.tool.bot.flakytestreporter import FlakyTestReporter
-from webkitpy.tool.mocktool import MockTool
+from webkitpy.tool.mocktool import MockTool, MockStatusServer
 
 
 # Creating fake CommitInfos is a pain, so we use a mock one here.
@@ -79,4 +79,10 @@ If you would like to track this test fix with another bug, please close this bug
 """
         OutputCapture().assert_outputs(self, reporter._create_bug_for_flaky_test, ['foo/bar.html', ['test at test.com'], 'FLAKE_MESSAGE'], expected_stderr=expected_stderr)
 
+    def test_bot_information(self):
+        tool = MockTool()
+        tool.status_server = MockStatusServer("MockBotId")
+        reporter = FlakyTestReporter(tool, 'dummy-queue')
+        self.assertEqual(reporter._bot_information(), "Bot Id: MockBotId Port: MockPort OS: MockPlatform 1.0")
+
     # report_flaky_tests is tested by queues_unittest
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
index bc9f30c..0a4722e 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
@@ -327,11 +327,13 @@ MOCK: release_work_item: commit-queue 197
         expected_stderr = """MOCK bug comment: bug_id=42, cc=None
 --- Begin comment ---
 The commit-queue just saw foo/bar.html flake while processing attachment 197 on bug 42.
+Port: MockPort OS: MockPlatform 1.0
 --- End comment ---
 
 MOCK bug comment: bug_id=42, cc=None
 --- Begin comment ---
 The commit-queue just saw bar/baz.html flake while processing attachment 197 on bug 42.
+Port: MockPort OS: MockPlatform 1.0
 --- End comment ---
 
 MOCK bug comment: bug_id=42, cc=None
diff --git a/WebKitTools/Scripts/webkitpy/tool/main.py b/WebKitTools/Scripts/webkitpy/tool/main.py
index 7b1d7f3..c8d0ffb 100755
--- a/WebKitTools/Scripts/webkitpy/tool/main.py
+++ b/WebKitTools/Scripts/webkitpy/tool/main.py
@@ -41,6 +41,7 @@ from webkitpy.common.net.buildbot import BuildBot
 from webkitpy.common.net.irc.ircproxy import IRCProxy
 from webkitpy.common.net.statusserver import StatusServer
 from webkitpy.common.system.executive import Executive
+from webkitpy.common.system.platform import Platform
 from webkitpy.common.system.user import User
 from webkitpy.layout_tests import port
 from webkitpy.tool.multicommandtool import MultiCommandTool
@@ -62,6 +63,10 @@ class WebKitPatch(MultiCommandTool):
 
         self._path = path
         self.wakeup_event = threading.Event()
+        # FIXME: All of these shared objects should move off onto a
+        # separate "Tool" object.  WebKitPatch should inherit from
+        # "Tool" and all these objects should use getters/setters instead of
+        # manual getter functions (e.g. scm()).
         self.bugs = Bugzilla()
         self.buildbot = BuildBot()
         self.executive = Executive()
@@ -72,6 +77,7 @@ class WebKitPatch(MultiCommandTool):
         self._checkout = None
         self.status_server = StatusServer()
         self.port_factory = port.factory
+        self.platform = Platform()
 
     def scm(self):
         # Lazily initialize SCM to not error-out before command line parsing (or when running non-scm commands).
diff --git a/WebKitTools/Scripts/webkitpy/tool/mocktool.py b/WebKitTools/Scripts/webkitpy/tool/mocktool.py
index e2c816d..791ebd6 100644
--- a/WebKitTools/Scripts/webkitpy/tool/mocktool.py
+++ b/WebKitTools/Scripts/webkitpy/tool/mocktool.py
@@ -613,6 +613,10 @@ class MockOptions(object):
             self.__dict__[key] = value
 
 
+class MockPort(Mock):
+    def name(self):
+        return "MockPort"
+
 class MockTestPort1(object):
 
     def skips_layout_test(self, test_name):
@@ -631,6 +635,11 @@ class MockPortFactory(object):
         return {"test_port1": MockTestPort1(), "test_port2": MockTestPort2()}
 
 
+class MockPlatform(object):
+    def display_name(self):
+        return "MockPlatform 1.0"
+
+
 class MockTool(object):
 
     def __init__(self, log_executive=False):
@@ -645,6 +654,7 @@ class MockTool(object):
         self.status_server = MockStatusServer()
         self.irc_password = "MOCK irc password"
         self.port_factory = MockPortFactory()
+        self.platform = MockPlatform()
 
     def scm(self):
         return self._scm
@@ -663,7 +673,7 @@ class MockTool(object):
         return "echo"
 
     def port(self):
-        return Mock()
+        return MockPort()
 
 
 class MockBrowser(object):

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list