Bug 1437912 - [moztest] Make TEST_SUITES aliases case insensitive, r?gbrown draft
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Thu, 15 Feb 2018 11:44:44 -0500
changeset 756175 e0361e8d3b1174559f9220e5c061339b48c1b26a
parent 756125 928f0f09172fae67f6ec00e7a63969f7b28bd12e
child 756176 832a5d35c0735e108d457c61359e2be4754b4959
push id99404
push userahalberstadt@mozilla.com
push dateFri, 16 Feb 2018 15:03:51 +0000
reviewersgbrown
bugs1437912
milestone60.0a1
Bug 1437912 - [moztest] Make TEST_SUITES aliases case insensitive, r?gbrown This removes a lot of redundant alias definitions by calling lower() on the user input. It also adds a couple of new aliases that look like they might be useful. MozReview-Commit-ID: 3Aix4LPB8wg
testing/mozbase/moztest/moztest/resolve.py
--- a/testing/mozbase/moztest/moztest/resolve.py
+++ b/testing/mozbase/moztest/moztest/resolve.py
@@ -19,89 +19,92 @@ from mozversioncontrol import get_reposi
 here = os.path.abspath(os.path.dirname(__file__))
 
 
 MOCHITEST_CHUNK_BY_DIR = 4
 MOCHITEST_TOTAL_CHUNKS = 5
 
 TEST_SUITES = {
     'cppunittest': {
-        'aliases': ('Cpp', 'cpp'),
+        'aliases': ('cpp',),
         'mach_command': 'cppunittest',
         'kwargs': {'test_file': None},
     },
     'crashtest': {
-        'aliases': ('C', 'Rc', 'RC', 'rc'),
+        'aliases': ('c', 'rc'),
         'mach_command': 'crashtest',
         'kwargs': {'test_file': None},
     },
     'firefox-ui-functional': {
-        'aliases': ('Fxfn',),
+        'aliases': ('fxfn',),
         'mach_command': 'firefox-ui-functional',
         'kwargs': {},
     },
     'firefox-ui-update': {
-        'aliases': ('Fxup',),
+        'aliases': ('fxup',),
         'mach_command': 'firefox-ui-update',
         'kwargs': {},
     },
     'check-spidermonkey': {
-        'aliases': ('Sm', 'sm'),
+        'aliases': ('sm',),
         'mach_command': 'check-spidermonkey',
         'kwargs': {'valgrind': False},
     },
     # TODO(ato): integrate geckodriver tests with moz.build
     'geckodriver': {
         'mach_command': 'geckodriver-test',
         'aliases': ('testing/geckodriver',),
         'kwargs': {},
     },
     'mochitest-a11y': {
+        'aliases': ('a11y', 'ally'),
         'mach_command': 'mochitest',
         'kwargs': {'flavor': 'a11y', 'test_paths': None},
     },
     'mochitest-browser': {
-        'aliases': ('bc', 'BC', 'Bc'),
+        'aliases': ('bc', 'browser-chrome'),
         'mach_command': 'mochitest',
         'kwargs': {'flavor': 'browser-chrome', 'test_paths': None},
     },
     'mochitest-chrome': {
+        'aliases': ('mc',),
         'mach_command': 'mochitest',
         'kwargs': {'flavor': 'chrome', 'test_paths': None},
     },
     'mochitest-devtools': {
-        'aliases': ('dt', 'DT', 'Dt'),
+        'aliases': ('dt', 'devtools-chrome'),
         'mach_command': 'mochitest',
         'kwargs': {'subsuite': 'devtools', 'test_paths': None},
     },
     'mochitest-plain': {
+        'aliases': ('mp', 'plain',),
         'mach_command': 'mochitest',
         'kwargs': {'flavor': 'plain', 'test_paths': None},
     },
     'python': {
         'mach_command': 'python-test',
         'kwargs': {'tests': None},
     },
     'reftest': {
-        'aliases': ('RR', 'rr', 'Rr'),
+        'aliases': ('rr',),
         'mach_command': 'reftest',
         'kwargs': {'tests': None},
     },
     'web-platform-tests': {
         'aliases': ('wpt',),
         'mach_command': 'web-platform-tests',
         'kwargs': {}
     },
     'valgrind': {
-        'aliases': ('V', 'v'),
+        'aliases': ('v',),
         'mach_command': 'valgrind-test',
         'kwargs': {},
     },
     'xpcshell': {
-        'aliases': ('X', 'x'),
+        'aliases': ('x',),
         'mach_command': 'xpcshell-test',
         'kwargs': {'test_file': 'all'},
     },
 }
 
 # Maps test flavors to metadata on how to run that test.
 TEST_FLAVORS = {
     'a11y': {
@@ -156,17 +159,17 @@ TEST_FLAVORS = {
         'mach_command': 'xpcshell-test',
         'kwargs': {'test_paths': []},
         'task_regex': 'xpcshell(?:-1)?$',
     },
 }
 
 for i in range(1, MOCHITEST_TOTAL_CHUNKS + 1):
     TEST_SUITES['mochitest-%d' % i] = {
-        'aliases': ('M%d' % i, 'm%d' % i),
+        'aliases': ('m%d' % i,),
         'mach_command': 'mochitest',
         'kwargs': {
             'flavor': 'mochitest',
             'subsuite': 'default',
             'chunk_by_dir': MOCHITEST_CHUNK_BY_DIR,
             'total_chunks': MOCHITEST_TOTAL_CHUNKS,
             'this_chunk': i,
             'test_paths': None,
@@ -450,17 +453,17 @@ class TestResolver(MozbuildObject):
         for entry in what:
             # If the path matches the name or alias of an entire suite, run
             # the entire suite.
             if entry in TEST_SUITES:
                 run_suites.add(entry)
                 continue
             suitefound = False
             for suite, v in TEST_SUITES.items():
-                if entry in v.get('aliases', []):
+                if entry.lower() in v.get('aliases', []):
                     run_suites.add(suite)
                     suitefound = True
             if suitefound:
                 continue
 
             # Now look for file/directory matches in the TestResolver.
             relpath = self._wrap_path_argument(entry).relpath()
             tests = list(self.resolve_tests(paths=[relpath]))