diff --git a/testing/mozbase/moztest/moztest/resolve.py b/testing/mozbase/moztest/moztest/resolve.py index 0299405ea20a..48ed4229bd63 100644 --- a/testing/mozbase/moztest/moztest/resolve.py +++ b/testing/mozbase/moztest/moztest/resolve.py @@ -28,8 +28,8 @@ def WebglSuite(name): 'aliases': (name,), 'mach_command': 'mochitest', 'kwargs': {'flavor': 'plain', 'subsuite': name, 'test_paths': None}, - 'task_regex': ['mochitest-' + name + '(?:-e10s)?(?:-1)?$', - 'test-verify(?:-gpu)?(?:-e10s)?(?:-1)?$'], + 'task_regex': ['mochitest-' + name + '($|.*(-1|[^0-9])$)', + 'test-verify($|.*(-1|[^0-9])$)'], } @@ -74,63 +74,63 @@ TEST_SUITES = { 'aliases': ('a11y', 'ally'), 'mach_command': 'mochitest', 'kwargs': {'flavor': 'a11y', 'test_paths': None}, - 'task_regex': ['mochitest-a11y(?:-1)?$', - 'test-verify(?:-e10s)?(?:-1)?$'], + 'task_regex': ['mochitest-a11y($|.*(-1|[^0-9])$)', + 'test-verify($|.*(-1|[^0-9])$)'], }, 'mochitest-browser': { 'aliases': ('bc', 'browser-chrome'), 'mach_command': 'mochitest', 'kwargs': {'flavor': 'browser-chrome', 'test_paths': None}, - 'task_regex': ['mochitest-browser-chrome(?:-e10s)?(?:-1)?$', - 'test-verify(?:-e10s)?(?:-1)?$'], + 'task_regex': ['mochitest-browser-chrome($|.*(-1|[^0-9])$)', + 'test-verify($|.*(-1|[^0-9])$)'], }, 'mochitest-chrome': { 'aliases': ('mc',), 'mach_command': 'mochitest', 'kwargs': {'flavor': 'chrome', 'test_paths': None}, - 'task_regex': ['mochitest-chrome(?:-e10s)?(?:-1)?$', - 'test-verify(?:-e10s)?(?:-1)?$'], + 'task_regex': ['mochitest-chrome($|.*(-1|[^0-9])$)', + 'test-verify($|.*(-1|[^0-9])$)'], }, 'mochitest-clipboard': { 'aliases': ('cl', 'clipboard',), 'mach_command': 'mochitest', 'kwargs': {'subsuite': 'clipboard', 'test_paths': None}, - 'task_regex': ['mochitest-clipboard(?:-e10s)?(?:-1)?$', - 'test-verify(?:-e10s)?(?:-1)?$'], + 'task_regex': ['mochitest-clipboard($|.*(-1|[^0-9])$)', + 'test-verify($|.*(-1|[^0-9])$)'], }, 'mochitest-devtools': { 'aliases': ('dt', 'devtools-chrome'), 'mach_command': 'mochitest', 'kwargs': {'flavor': 'browser-chrome', 'subsuite': 'devtools', 'test_paths': None}, - 'task_regex': ['mochitest-devtools-chrome(?:-e10s)?(?:-1)?$', - 'test-verify(?:-e10s)?(?:-1)?$'], + 'task_regex': ['mochitest-devtools-chrome($|.*(-1|[^0-9])$)', + 'test-verify($|.*(-1|[^0-9])$)'], }, 'mochitest-gpu': { 'aliases': ('gpu',), 'mach_command': 'mochitest', 'kwargs': {'subsuite': 'gpu', 'test_paths': None}, - 'task_regex': ['mochitest-gpu(?:-e10s)?(?:-1)?$', - 'test-verify(?:-gpu)?(?:-e10s)?(?:-1)?$'], + 'task_regex': ['mochitest-gpu($|.*(-1|[^0-9])$)', + 'test-verify($|.*(-1|[^0-9])$)'], }, 'mochitest-media': { 'aliases': ('mpm', 'plain-media'), 'mach_command': 'mochitest', 'kwargs': {'flavor': 'plain', 'subsuite': 'media', 'test_paths': None}, - 'task_regex': ['mochitest-media(?:-e10s)?(?:-1)?$', - 'test-verify(?:-e10s)?(?:-1)?$'], + 'task_regex': ['mochitest-media($|.*(-1|[^0-9])$)', + 'test-verify($|.*(-1|[^0-9])$)'], }, 'mochitest-plain': { 'aliases': ('mp', 'plain',), 'mach_command': 'mochitest', 'kwargs': {'flavor': 'plain', 'test_paths': None}, - 'task_regex': ['mochitest(?:-e10s)?(?:-1)?$', - 'test-verify(?:-e10s)?(?:-1)?$'], + 'task_regex': ['mochitest(?!-a11y|-browser|-chrome|-clip|-devtools|-gpu|-media|-screen)($|.*(-1|[^0-9])$)', # noqa + 'test-verify($|.*(-1|[^0-9])$)'], }, 'mochitest-screenshots': { 'aliases': ('ss', 'screenshots-chrome'), 'mach_command': 'mochitest', 'kwargs': {'flavor': 'browser-chrome', 'subsuite': 'screenshots', 'test_paths': None}, - 'task_regex': ['browser-screenshots(?:-e10s)?(?:-1)?$'], + 'task_regex': ['browser-screenshots($|.*(-1|[^0-9])$)'], }, 'mochitest-webgl1-core': WebglSuite('webgl1-core'), 'mochitest-webgl1-ext': WebglSuite('webgl1-ext'), @@ -145,40 +145,40 @@ TEST_SUITES = { 'aliases': ('rr',), 'mach_command': 'reftest', 'kwargs': {'tests': None}, - 'task_regex': ['(opt|debug)-reftest(?:-no-accel|-gpu|-stylo)?(?:-e10s)?(?:-1)?$', - 'test-verify-gpu(?:-e10s)?(?:-1)?$'], + 'task_regex': ['(opt|debug)-reftest($|.*(-1|[^0-9])$)', + 'test-verify-gpu($|.*(-1|[^0-9])$)'], }, 'robocop': { 'mach_command': 'robocop', 'kwargs': {'test_paths': None}, - 'task_regex': ['robocop(?:-e10s)?(?:-1)?$'], + 'task_regex': ['robocop($|.*(-1|[^0-9])$)'], }, 'web-platform-tests': { 'aliases': ('wpt',), 'mach_command': 'web-platform-tests', 'kwargs': {'include': []}, - 'task_regex': ['web-platform-tests(?:-reftests|-wdspec)?(?:-e10s)?(?:-1)?$', + 'task_regex': ['web-platform-tests($|.*(-1|[^0-9])$)', 'test-verify-wpt-e10s'], }, 'web-platform-tests-testharness': { 'aliases': ('wpt',), 'mach_command': 'web-platform-tests', 'kwargs': {'include': []}, - 'task_regex': ['web-platform-tests(?:-e10s)?(?:-1)?$', + 'task_regex': ['web-platform-tests(?!-reftest|-wdspec)($|.*(-1|[^0-9])$)', 'test-verify-wpt-e10s'], }, 'web-platform-tests-reftest': { 'aliases': ('wpt',), 'mach_command': 'web-platform-tests', 'kwargs': {'include': []}, - 'task_regex': ['web-platform-tests-reftests(?:-e10s)?(?:-1)?$', + 'task_regex': ['web-platform-tests-reftests($|.*(-1|[^0-9])$)', 'test-verify-wpt-e10s'], }, 'web-platform-tests-wdspec': { 'aliases': ('wpt',), 'mach_command': 'web-platform-tests', 'kwargs': {'include': []}, - 'task_regex': ['web-platform-tests-wdspec(?:-e10s)?(?:-1)?$', + 'task_regex': ['web-platform-tests-wdspec($|.*(-1|[^0-9])$)', 'test-verify-wpt-e10s'], }, 'valgrind': { @@ -190,7 +190,8 @@ TEST_SUITES = { 'aliases': ('x',), 'mach_command': 'xpcshell-test', 'kwargs': {'test_file': 'all'}, - 'task_regex': ['xpcshell(?:-1)?$', 'test-verify(?:-1)?$'], + 'task_regex': ['xpcshell($|.*(-1|[^0-9])$)', + 'test-verify($|.*(-1|[^0-9])$)'], }, } diff --git a/testing/mozbase/moztest/tests/test_resolve.py b/testing/mozbase/moztest/tests/test_resolve.py index e960bb94a74b..0c6db8a15dc0 100644 --- a/testing/mozbase/moztest/tests/test_resolve.py +++ b/testing/mozbase/moztest/tests/test_resolve.py @@ -3,7 +3,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # flake8: noqa: E501 -from __future__ import absolute_import, unicode_literals +from __future__ import absolute_import, print_function, unicode_literals import cPickle as pickle import os @@ -407,6 +407,8 @@ class TestTestResolver(Base): 'mochitest-plain': [ 'test-linux64/opt-mochitest', 'test-linux64/debug-mochitest-e10s', + # this isn't a real task but the regex would match it if it were + 'test-linux64/opt-mochitest-plain', ], 'mochitest-screenshots': [ 'test-linux64/opt-browser-screenshots-1', @@ -425,6 +427,7 @@ class TestTestResolver(Base): 'web-platform-tests': [ 'test-linux64/opt-web-platform-tests-e10s-1', 'test-linux64/opt-web-platform-tests-reftests-e10s-1', + 'test-linux64/opt-web-platform-tests-reftest-e10s-1', 'test-linux64/opt-web-platform-tests-wdspec-e10s-1', 'test-linux64/opt-web-platform-tests-1', ], @@ -450,6 +453,7 @@ class TestTestResolver(Base): return any(re.search(pattern, task) for pattern in regexes) for suite, expected in sorted(test_cases.items()): + print(suite) regexes = TEST_SUITES[suite]['task_regex'] assert set(filter(match_task, TASK_LABELS)) == set(expected)