Bug 1583353 - [moztest.resolve] Create an 'is_puppeteer_loaded' flag r=gbrown

This prevents us from adding the puppeteer tests over and over again. It
follows the wpt example.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew Halberstadt 2019-10-21 19:24:06 +00:00
Родитель fb84f5763d
Коммит ca37f985b6
2 изменённых файлов: 10 добавлений и 3 удалений

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

@ -13,12 +13,11 @@ from collections import defaultdict
import manifestparser
import mozpack.path as mozpath
from mozbuild.base import MozbuildObject
from mozbuild.util import OrderedDefaultDict
from mozbuild.frontend.reader import BuildReader, EmptyConfig
from mozbuild.util import OrderedDefaultDict
here = os.path.abspath(os.path.dirname(__file__))
MOCHITEST_CHUNK_BY_DIR = 4
MOCHITEST_TOTAL_CHUNKS = 5
@ -333,6 +332,7 @@ class TestMetadata(object):
self._tests_by_flavor = defaultdict(set)
self._test_dirs = set()
self._objdir = os.path.abspath(os.path.join(all_tests, os.pardir))
self._puppeteer_loaded = False
self._wpt_loaded = False
self._srcdir = srcdir
@ -461,6 +461,9 @@ class TestMetadata(object):
return mozpath.match(path, "remote/test/puppeteer/test/**")
def add_puppeteer_manifest_data(self):
if self._puppeteer_loaded:
return
test_path = os.path.join(self._srcdir, "remote", "test", "puppeteer", "test")
for root, dirs, paths in os.walk(test_path):
for filename in fnmatch.filter(paths, "*.spec.js"):
@ -479,6 +482,8 @@ class TestMetadata(object):
"srcdir_relpath": path,
})
self._puppeteer_loaded = True
def is_wpt_path(self, path):
if path is None:
return True

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

@ -220,7 +220,9 @@ class Base(unittest.TestCase):
self._temp_files.append(test_defaults)
rv = TestMetadata(all_tests.name, "/firefox/", test_defaults=test_defaults.name)
rv._wpt_loaded = True # Don't try to load the wpt manifest
# Avoid loading wpt or puppeteer manifests.
rv._wpt_loaded = True
rv._puppeteer_loaded = True
return rv