Bug 1368264 - Make WPT use WebDriver binary from test archive r=jgraham

Instead of fetching geckodriver from tooltool, we ask mozharness to
pick up the geckodriver binary from the common test archive.  As it
is packaged under /bin along with other test-relevant binaries such as
wptserve, we can retrieve it from the abs_test_install_dir.

It would also be possible to use ScriptMixin.query_exe for this purpose
after specifying the binary in the "exes" section of the different
mozharness configs, but this seems needlessly complicated.

Because we also do not yet have geckodriver on all platforms, we only
want to look for it if requested to run the wdspec test type.

MozReview-Commit-ID: 7jLuBeDiQNE

--HG--
extra : rebase_source : ea8c1be063be0f40ff4c8f8c3a77b1b57580829d
This commit is contained in:
Andreas Tolfsen 2017-06-05 16:05:19 +01:00
Родитель 59bc25c52a
Коммит 82f29e902c
2 изменённых файлов: 6 добавлений и 50 удалений

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

@ -1,9 +0,0 @@
[
{
"size": 2183421,
"visibility": "public",
"digest": "8e201c5f0f5494cc89b7caad509b2618b1f1b668ac8a81d56df2514968b62b4e06765e9a4e42b7fb273c94d1ca2a712446599654a04716aec204fa8e6a1cee5b",
"algorithm": "sha512",
"filename": "geckodriver-v0.16.1-linux64.tar.gz"
}
]

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

@ -73,7 +73,6 @@ class WebPlatformTest(TestingMixin, MercurialScript, BlobUploadMixin, CodeCovera
'clobber',
'read-buildbot-config',
'download-and-extract',
'fetch-geckodriver',
'create-virtualenv',
'pull',
'install',
@ -90,7 +89,6 @@ class WebPlatformTest(TestingMixin, MercurialScript, BlobUploadMixin, CodeCovera
self.installer_path = c.get('installer_path')
self.binary_path = c.get('binary_path')
self.abs_app_dir = None
self.geckodriver_path = None
def query_abs_app_dir(self):
"""We can't set this in advance, because OSX install directories
@ -111,6 +109,7 @@ class WebPlatformTest(TestingMixin, MercurialScript, BlobUploadMixin, CodeCovera
dirs = {}
dirs['abs_app_install_dir'] = os.path.join(abs_dirs['abs_work_dir'], 'application')
dirs['abs_test_install_dir'] = os.path.join(abs_dirs['abs_work_dir'], 'tests')
dirs['abs_test_bin_dir'] = os.path.join(dirs['abs_test_install_dir'], 'bin')
dirs["abs_wpttest_dir"] = os.path.join(dirs['abs_test_install_dir'], "web-platform")
dirs['abs_blob_upload_dir'] = os.path.join(abs_dirs['abs_work_dir'], 'blobber_upload_dir')
@ -171,8 +170,11 @@ class WebPlatformTest(TestingMixin, MercurialScript, BlobUploadMixin, CodeCovera
cmd.append("--%s=%s" % (opt.replace("_", "-"), val))
if "wdspec" in c.get("test_type", []):
assert self.geckodriver_path is not None
cmd.append("--webdriver-binary=%s" % self.geckodriver_path)
geckodriver_path = os.path.join(dirs["abs_test_bin_dir"], "geckodriver")
if not os.path.isfile(geckodriver_path):
self.fatal("Unable to find geckodriver binary "
"in common test package: %s" % geckodriver_path)
cmd.append("--webdriver-binary=%s" % geckodriver_path)
options = list(c.get("options", []))
@ -204,43 +206,6 @@ class WebPlatformTest(TestingMixin, MercurialScript, BlobUploadMixin, CodeCovera
"web-platform/*"],
suite_categories=["web-platform"])
def fetch_geckodriver(self):
c = self.config
dirs = self.query_abs_dirs()
platform_name = self.platform_name()
if "wdspec" not in c.get("test_type", []):
return
if platform_name != "linux64":
self.fatal("Don't have a geckodriver for %s" % platform_name)
tooltool_path = os.path.join(dirs["abs_test_install_dir"],
"config",
"tooltool-manifests",
TOOLTOOL_PLATFORM_DIR[platform_name],
"geckodriver.manifest")
with open(tooltool_path) as f:
manifest = json.load(f)
assert len(manifest) == 1
geckodriver_filename = manifest[0]["filename"]
assert geckodriver_filename.endswith(".tar.gz")
self.tooltool_fetch(
manifest=tooltool_path,
output_dir=dirs['abs_work_dir'],
cache=c.get('tooltool_cache')
)
compressed_path = os.path.join(dirs['abs_work_dir'], geckodriver_filename)
tar = self.query_exe('tar', return_type="list")
self.run_command(tar + ["xf", compressed_path], cwd=dirs['abs_work_dir'],
halt_on_failure=True, fatal_exit_code=3)
self.geckodriver_path = os.path.join(dirs['abs_work_dir'], "geckodriver")
def run_tests(self):
dirs = self.query_abs_dirs()
cmd = self._query_cmd()