Summary: | Sheriffbot command aliases need test cases | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Alan Cutter <alancutter> | ||||||
Component: | Tools / Tests | Assignee: | 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
Alan Cutter
2013-01-13 21:28:22 PST
Created attachment 182506 [details]
Patch
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? (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. 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. :) Created attachment 182518 [details]
Patch
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. (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. Comment on attachment 182518 [details]
Patch
Thanks agian.
Comment on attachment 182518 [details] Patch Clearing flags on attachment: 182518 Committed r139592: <http://trac.webkit.org/changeset/139592> All reviewed patches have been landed. Closing bug. |