зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1470266 - [moztest.resolve] Make task regexes more resilient to change, r=jmaher
These regexes are used for things like determining which tasks to run given a "path" int |mach try|. Previously, we used patterns like: mochitest-chrome-(?:e10s)?(?:-1)?$ This would match both e10s and non-e10s versions of a task with either no chunks, or only selecting chunk 1. But we keep adding other configurations, e.g -gpu, -no-accel, -sw, etc. Each time we create a new possibility we need to remember to update these task regexes (or else lose test coverage when using paths with |mach try|). Instead of individually listing every possibility, let's use a pattern like this: mochitest-chrome($|.*(-1|[^0-9])$) This also selects tasks that are either chunk 1 or don't have any chunks. But it allows for arbitrary strings in-between. This regex doesn't need to be updated when we add configurations like -sw. Depends on D7119 Differential Revision: https://phabricator.services.mozilla.com/D7120 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
aebcf45519
Коммит
9e9fc55acc
|
@ -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])$)'],
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче