Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Unified Diff: tests/trychange_unittest.py

Issue 54373011: Rework bot and test parsing to allow receipt of (bot, set(test)) specifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Final changes. Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « presubmit_support.py ('k') | trychange.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/trychange_unittest.py
diff --git a/tests/trychange_unittest.py b/tests/trychange_unittest.py
index ebcf14b137b272dd80dcbb099b66578f956d88e8..f595592080b1958fc61efac64e0b43cd9eff6a04 100755
--- a/tests/trychange_unittest.py
+++ b/tests/trychange_unittest.py
@@ -51,8 +51,8 @@ class TryChangeUnittest(TryChangeTestsBase):
'PrintSuccess',
'RunCommand', 'RunGit', 'SCM', 'SVN', 'TryChange', 'USAGE', 'breakpad',
'datetime', 'errno', 'fix_encoding', 'gcl', 'gclient_utils', 'gen_parser',
- 'getpass', 'json', 'logging', 'optparse', 'os', 'posixpath', 're', 'scm',
- 'shutil', 'subprocess2', 'sys', 'tempfile', 'urllib']
+ 'getpass', 'itertools', 'json', 'logging', 'optparse', 'os', 'posixpath',
+ 're', 'scm', 'shutil', 'subprocess2', 'sys', 'tempfile', 'urllib']
# If this test fails, you should add the relevant test.
self.compareMembers(trychange, members)
@@ -70,7 +70,10 @@ class TryChangeSimpleTest(unittest.TestCase):
options, args = trychange.gen_parser(None).parse_args(cmd)
self.assertEquals([], args)
# pylint: disable=W0212
- values = trychange._ParseSendChangeOptions(options)
+ bot_spec = trychange._ParseBotList(options.bot, options.testfilter)
+ if options.testfilter:
+ bot_spec = trychange._ApplyTestFilter(options.testfilter, bot_spec)
+ values = trychange._ParseSendChangeOptions(bot_spec, options)
self.assertEquals(
[
('user', 'joe'),
@@ -90,7 +93,7 @@ class TryChangeSimpleTest(unittest.TestCase):
self.assertEquals([], args)
try:
# pylint: disable=W0212
- trychange._ParseSendChangeOptions(options)
+ trychange._ParseBotList(options.bot, options.testfilter)
self.fail()
except ValueError:
pass
« no previous file with comments | « presubmit_support.py ('k') | trychange.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698