Bug 1500081 - Use --install-fonts to install fonts for wptrunner, r=automatedtester

This replaces a previous Firefox-only method except on Windows 7 where
it seems that we have some issues with the registry.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
James Graham 2018-10-18 13:44:36 +00:00
Родитель 358eb27dd0
Коммит f1018bf278
3 изменённых файлов: 15 добавлений и 4 удалений

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

@ -233,6 +233,12 @@ class WebPlatformTest(TestingMixin, MercurialScript, CodeCoverageMixin, AndroidM
if not sys.platform.startswith("linux"):
cmd += ["--exclude=css"]
if mozinfo.info["os"] == "win" and mozinfo.info["os_version"] == "6.1":
# On Windows 7 --install-fonts fails, so fall back to a Firefox-specific codepath
self._install_fonts()
else:
cmd += ["--install-fonts"]
for test_type in test_types:
cmd.append("--test-type=%s" % test_type)
@ -329,8 +335,6 @@ class WebPlatformTest(TestingMixin, MercurialScript, CodeCoverageMixin, AndroidM
def run_tests(self):
dirs = self.query_abs_dirs()
self._install_fonts()
parser = StructuredOutputParser(config=self.config,
log_obj=self.log_obj,
log_compact=True,

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

@ -78,6 +78,7 @@ class WebPlatformTestsRunnerSetup(MozbuildObject):
return kwargs
def kwargs_firefox(self, kwargs):
import mozinfo
from wptrunner import wptcommandline
kwargs = self.kwargs_common(kwargs)
@ -90,7 +91,12 @@ class WebPlatformTestsRunnerSetup(MozbuildObject):
if kwargs["webdriver_binary"] is None:
kwargs["webdriver_binary"] = self.get_binary_path("geckodriver", validate_exists=False)
self.setup_fonts_firefox()
if mozinfo.info["os"] == "win" and mozinfo.info["os_version"] == "6.1":
# On Windows 7 --install-fonts fails, so fall back to a Firefox-specific codepath
self.setup_fonts_firefox()
else:
kwargs["install_fonts"] = True
kwargs = wptcommandline.check_args(kwargs)
@ -141,6 +147,7 @@ class WebPlatformTestsRunnerSetup(MozbuildObject):
dest.write(src.read())
class WebPlatformTestsUpdater(MozbuildObject):
"""Update web platform tests."""
def setup_logging(self, **kwargs):

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

@ -150,7 +150,7 @@ def run_tests(config, test_paths, product, **kwargs):
if kwargs["install_fonts"]:
env_extras.append(FontInstaller(
font_dir=kwargs["font_dir"],
ahem=os.path.join(kwargs["tests_root"], "fonts/Ahem.ttf")
ahem=os.path.join(test_paths["/"]["tests_path"], "fonts/Ahem.ttf")
))
run_info, test_loader = get_loader(test_paths,