Changeset 73798 in webkit
- Timestamp:
- Dec 10, 2010 1:42:04 PM (13 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r73789 r73798 1 2010-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 1 20 2010-12-10 Krithigassree Sambamurthy <krithigassree.sambamurthy@nokia.com> 2 21 -
trunk/WebKitTools/Scripts/webkitpy/tool/bot/flakytestreporter.py
r73694 r73798 28 28 29 29 import logging 30 import platform 30 31 31 32 from webkitpy.common.net.layouttestresults import path_for_layout_test, LayoutTestResults … … 97 98 return " (%s: %s)" % (heading_string, authors_string) 98 99 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 99 109 def report_flaky_tests(self, flaky_tests, patch): 100 110 message = "The %s encountered the following flaky tests while processing attachment %s:\n\n" % (self._bot_name, patch.id()) 101 111 for flaky_test in flaky_tests: 102 112 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) 104 114 author_emails = self._author_emails_for_test(flaky_test) 105 115 if not bug: -
trunk/WebKitTools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py
r73694 r73798 32 32 from webkitpy.common.system.outputcapture import OutputCapture 33 33 from webkitpy.tool.bot.flakytestreporter import FlakyTestReporter 34 from webkitpy.tool.mocktool import MockTool 34 from webkitpy.tool.mocktool import MockTool, MockStatusServer 35 35 36 36 … … 80 80 OutputCapture().assert_outputs(self, reporter._create_bug_for_flaky_test, ['foo/bar.html', ['test@test.com'], 'FLAKE_MESSAGE'], expected_stderr=expected_stderr) 81 81 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 82 88 # report_flaky_tests is tested by queues_unittest -
trunk/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
r73691 r73798 328 328 --- Begin comment --- 329 329 The commit-queue just saw foo/bar.html flake while processing attachment 197 on bug 42. 330 Port: MockPort OS: MockPlatform 1.0 330 331 --- End comment --- 331 332 … … 333 334 --- Begin comment --- 334 335 The commit-queue just saw bar/baz.html flake while processing attachment 197 on bug 42. 336 Port: MockPort OS: MockPlatform 1.0 335 337 --- End comment --- 336 338 -
trunk/WebKitTools/Scripts/webkitpy/tool/main.py
r71667 r73798 42 42 from webkitpy.common.net.statusserver import StatusServer 43 43 from webkitpy.common.system.executive import Executive 44 from webkitpy.common.system.platform import Platform 44 45 from webkitpy.common.system.user import User 45 46 from webkitpy.layout_tests import port … … 63 64 self._path = path 64 65 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()). 65 70 self.bugs = Bugzilla() 66 71 self.buildbot = BuildBot() … … 73 78 self.status_server = StatusServer() 74 79 self.port_factory = port.factory 80 self.platform = Platform() 75 81 76 82 def scm(self): -
trunk/WebKitTools/Scripts/webkitpy/tool/mocktool.py
r73691 r73798 614 614 615 615 616 class MockPort(Mock): 617 def name(self): 618 return "MockPort" 619 616 620 class MockTestPort1(object): 617 621 … … 630 634 def get_all(self, options=None): 631 635 return {"test_port1": MockTestPort1(), "test_port2": MockTestPort2()} 636 637 638 class MockPlatform(object): 639 def display_name(self): 640 return "MockPlatform 1.0" 632 641 633 642 … … 646 655 self.irc_password = "MOCK irc password" 647 656 self.port_factory = MockPortFactory() 657 self.platform = MockPlatform() 648 658 649 659 def scm(self): … … 664 674 665 675 def port(self): 666 return Mock ()676 return MockPort() 667 677 668 678
Note: See TracChangeset
for help on using the changeset viewer.