Bug 1582516 - Use TestManifestLoader for 'mach test-info'; r=ahal

Switch 'mach test-info report' and 'mach test-info tests' to use the TestManifestLoader.

Differential Revision: https://phabricator.services.mozilla.com/D54053

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Geoff Brown 2019-11-21 19:43:11 +00:00
Родитель 3e409cecde
Коммит c5fdf45f02
1 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -799,8 +799,9 @@ class TestInfoCommand(MachCommandBase):
self.full_test_name = self.test_name
# search for full_test_name in test manifests
from moztest.resolve import TestResolver
resolver = self._spawn(TestResolver)
from moztest.resolve import TestResolver, TestManifestLoader
here = os.path.abspath(os.path.dirname(__file__))
resolver = TestResolver.from_environment(cwd=here, loader_cls=TestManifestLoader)
relpath = self._wrap_path_argument(self.full_test_name).relpath()
tests = list(resolver.resolve_tests(paths=[relpath]))
if len(tests) == 1:
@ -1216,7 +1217,7 @@ class TestInfoCommand(MachCommandBase):
import mozpack.path as mozpath
import re
from mozbuild.build_commands import Build
from moztest.resolve import TestResolver
from moztest.resolve import TestResolver, TestManifestLoader
def matches_filters(test):
'''
@ -1259,7 +1260,8 @@ class TestInfoCommand(MachCommandBase):
builder.configure()
print("Finding tests...")
resolver = self._spawn(TestResolver)
here = os.path.abspath(os.path.dirname(__file__))
resolver = TestResolver.from_environment(cwd=here, loader_cls=TestManifestLoader)
tests = list(resolver.resolve_tests(paths=paths, flavor=flavor,
subsuite=subsuite))