Changeset 73798 in webkit


Ignore:
Timestamp:
Dec 10, 2010 1:42:04 PM (13 years ago)
Author:
eric@webkit.org
Message:

2010-12-10 Eric Seidel <eric@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:
Location:
trunk/WebKitTools
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r73789 r73798  
     12010-12-10  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Tony Chang.
     4
     5        commit-queue should report port/platform information when commenting on flaky test bugs
     6        https://bugs.webkit.org/show_bug.cgi?id=50839
     7
     8        This was a suggestion from Tony Chang this morning.
     9        I added a platform.py class so I could easily mock the platform call,
     10        but that may not be the final solution for this mocking.
     11        We'll try it and see.
     12
     13        * Scripts/webkitpy/common/system/platform.py: Added.
     14        * Scripts/webkitpy/tool/bot/flakytestreporter.py:
     15        * Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py:
     16        * Scripts/webkitpy/tool/commands/queues_unittest.py:
     17        * Scripts/webkitpy/tool/main.py:
     18        * Scripts/webkitpy/tool/mocktool.py:
     19
    1202010-12-10  Krithigassree Sambamurthy  <krithigassree.sambamurthy@nokia.com>
    221
  • trunk/WebKitTools/Scripts/webkitpy/tool/bot/flakytestreporter.py

    r73694 r73798  
    2828
    2929import logging
     30import platform
    3031
    3132from webkitpy.common.net.layouttestresults import path_for_layout_test, LayoutTestResults
     
    9798        return " (%s: %s)" % (heading_string, authors_string)
    9899
     100    def _bot_information(self):
     101        bot_id = self._tool.status_server.bot_id
     102        bot_id_string = "Bot Id: %s " % (bot_id) if bot_id else ""
     103        return "%sPort: %s OS: %s" % (bot_id_string, self._tool.port().name(), self._tool.platform.display_name())
     104
     105    def _latest_flake_message(self, flaky_test, patch):
     106        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())
     107        return "%s\n%s" % (flake_message, self._bot_information())
     108
    99109    def report_flaky_tests(self, flaky_tests, patch):
    100110        message = "The %s encountered the following flaky tests while processing attachment %s:\n\n" % (self._bot_name, patch.id())
    101111        for flaky_test in flaky_tests:
    102112            bug = self._lookup_bug_for_flaky_test(flaky_test)
    103             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())
     113            latest_flake_message = self._latest_flake_message(flaky_test, patch)
    104114            author_emails = self._author_emails_for_test(flaky_test)
    105115            if not bug:
  • trunk/WebKitTools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py

    r73694 r73798  
    3232from webkitpy.common.system.outputcapture import OutputCapture
    3333from webkitpy.tool.bot.flakytestreporter import FlakyTestReporter
    34 from webkitpy.tool.mocktool import MockTool
     34from webkitpy.tool.mocktool import MockTool, MockStatusServer
    3535
    3636
     
    8080        OutputCapture().assert_outputs(self, reporter._create_bug_for_flaky_test, ['foo/bar.html', ['test@test.com'], 'FLAKE_MESSAGE'], expected_stderr=expected_stderr)
    8181
     82    def test_bot_information(self):
     83        tool = MockTool()
     84        tool.status_server = MockStatusServer("MockBotId")
     85        reporter = FlakyTestReporter(tool, 'dummy-queue')
     86        self.assertEqual(reporter._bot_information(), "Bot Id: MockBotId Port: MockPort OS: MockPlatform 1.0")
     87
    8288    # report_flaky_tests is tested by queues_unittest
  • trunk/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py

    r73691 r73798  
    328328--- Begin comment ---
    329329The commit-queue just saw foo/bar.html flake while processing attachment 197 on bug 42.
     330Port: MockPort OS: MockPlatform 1.0
    330331--- End comment ---
    331332
     
    333334--- Begin comment ---
    334335The commit-queue just saw bar/baz.html flake while processing attachment 197 on bug 42.
     336Port: MockPort OS: MockPlatform 1.0
    335337--- End comment ---
    336338
  • trunk/WebKitTools/Scripts/webkitpy/tool/main.py

    r71667 r73798  
    4242from webkitpy.common.net.statusserver import StatusServer
    4343from webkitpy.common.system.executive import Executive
     44from webkitpy.common.system.platform import Platform
    4445from webkitpy.common.system.user import User
    4546from webkitpy.layout_tests import port
     
    6364        self._path = path
    6465        self.wakeup_event = threading.Event()
     66        # FIXME: All of these shared objects should move off onto a
     67        # separate "Tool" object.  WebKitPatch should inherit from
     68        # "Tool" and all these objects should use getters/setters instead of
     69        # manual getter functions (e.g. scm()).
    6570        self.bugs = Bugzilla()
    6671        self.buildbot = BuildBot()
     
    7378        self.status_server = StatusServer()
    7479        self.port_factory = port.factory
     80        self.platform = Platform()
    7581
    7682    def scm(self):
  • trunk/WebKitTools/Scripts/webkitpy/tool/mocktool.py

    r73691 r73798  
    614614
    615615
     616class MockPort(Mock):
     617    def name(self):
     618        return "MockPort"
     619
    616620class MockTestPort1(object):
    617621
     
    630634    def get_all(self, options=None):
    631635        return {"test_port1": MockTestPort1(), "test_port2": MockTestPort2()}
     636
     637
     638class MockPlatform(object):
     639    def display_name(self):
     640        return "MockPlatform 1.0"
    632641
    633642
     
    646655        self.irc_password = "MOCK irc password"
    647656        self.port_factory = MockPortFactory()
     657        self.platform = MockPlatform()
    648658
    649659    def scm(self):
     
    664674
    665675    def port(self):
    666         return Mock()
     676        return MockPort()
    667677
    668678
Note: See TracChangeset for help on using the changeset viewer.