Bug 106754

Summary: Sheriffbot command aliases need test cases
Product: WebKit Reporter: Alan Cutter <alancutter>
Component: Tools / TestsAssignee: Alan Cutter <alancutter>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, dpranke, eric, noel.gordon, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 106628    
Attachments:
Description Flags
Patch
none
Patch none

Alan Cutter
Reported 2013-01-13 21:28:22 PST
Currently there are no automated tests for Sheriffbot command aliases.
Attachments
Patch (2.05 KB, patch)
2013-01-13 22:02 PST, Alan Cutter
no flags
Patch (2.64 KB, patch)
2013-01-13 23:35 PST, Alan Cutter
no flags
Alan Cutter
Comment 1 2013-01-13 22:02:28 PST
Steve Block
Comment 2 2013-01-13 22:09:25 PST
Comment on attachment 182506 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=182506&action=review > Tools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:46 > + self.assertEqual(command, Sheriffs) Do you intend to add tests for the other sheriffbot commands too?
Alan Cutter
Comment 3 2013-01-13 22:14:21 PST
(In reply to comment #2) > (From update of attachment 182506 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=182506&action=review > > > Tools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:46 > > + self.assertEqual(command, Sheriffs) > > Do you intend to add tests for the other sheriffbot commands too? Yes, the other aliases had not landed at the time of writing. They have now so I'll add them.
Eric Seidel (no email)
Comment 4 2013-01-13 22:30:07 PST
Comment on attachment 182506 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=182506&action=review > Tools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:43 > + tool = MockTool() > + options = MockOptions() > + options.ensure_value("confirm", False) > + sheriffbot = SheriffBot() > + sheriffbot.execute(options, [], tool, MockQueueEngine) > + sheriffbot.begin_work_queue() > + irc_bot = sheriffbot._irc_bot Quite an epic amount of boiler plate. :)
Alan Cutter
Comment 5 2013-01-13 23:35:15 PST
Eric Seidel (no email)
Comment 6 2013-01-13 23:56:08 PST
Comment on attachment 182518 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=182518&action=review > Tools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:42 > + tool = MockTool() > + options = MockOptions() > + options.ensure_value("confirm", False) > + sheriffbot = SheriffBot() > + sheriffbot.execute(options, [], tool, MockQueueEngine) > + sheriffbot.begin_work_queue() Next time we add tests, this should probably move to a setUp() method (which is automatically called for you) > Tools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:46 > + revert_command, args = irc_bot._parse_command_and_args("revert") > + self.assertEqual(revert_command, Rollout) I often add a _assertCommandNamed(name, command) or similar helper method when the asserts take more than one line to execute.
Alan Cutter
Comment 7 2013-01-14 01:14:58 PST
(In reply to comment #6) > (From update of attachment 182518 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=182518&action=review > > > Tools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:42 > > + tool = MockTool() > > + options = MockOptions() > > + options.ensure_value("confirm", False) > > + sheriffbot = SheriffBot() > > + sheriffbot.execute(options, [], tool, MockQueueEngine) > > + sheriffbot.begin_work_queue() > > Next time we add tests, this should probably move to a setUp() method (which is automatically called for you) > > > Tools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:46 > > + revert_command, args = irc_bot._parse_command_and_args("revert") > > + self.assertEqual(revert_command, Rollout) > > I often add a _assertCommandNamed(name, command) or similar helper method when the asserts take more than one line to execute. Ah yes, I did notice that pattern in the EWS tests. Next change to Sheriffbot will come with more abstraction in the tests.
Eric Seidel (no email)
Comment 8 2013-01-14 01:24:54 PST
Comment on attachment 182518 [details] Patch Thanks agian.
WebKit Review Bot
Comment 9 2013-01-14 01:31:28 PST
Comment on attachment 182518 [details] Patch Clearing flags on attachment: 182518 Committed r139592: <http://trac.webkit.org/changeset/139592>
WebKit Review Bot
Comment 10 2013-01-14 01:31:32 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.