Skip to content
Permalink
Browse files

Add a nightly channel for testing with WebKitGTK on taskcluster. (web…

…-platform-tests#19595)

The nighly channel downloads the last nightly tarball available at
https://webkitgtk.org/built-products and installs it on taskcluster
when the test start.

This tarball is generated using the webkitgtk internal JHBuild, that
builds several third-party libraries needed for webkitgtk layout tests
and then builds webkitgtk on top of this libraries. Because of this
using this tarball requires installing quite a lot of extra dependencies
(that are needed by this extra third-party libraries). A script is
included inside the tarball to install this dependencies.
  • Loading branch information
clopez committed Oct 9, 2019
1 parent f695bb5 commit 13594b34977099bef7cca77a90feb0d1727f2cb5
Showing with 49 additions and 9 deletions.
  1. +4 −3 .taskcluster.yml
  2. +17 −1 tools/ci/run_tc.py
  3. +16 −2 tools/docker/Dockerfile
  4. +6 −1 tools/wpt/browser.py
  5. +2 −2 tools/wpt/run.py
  6. +4 −0 tools/wpt/tests/test_browser.py
@@ -12,15 +12,16 @@ tasks:
$flatten:
$match: {
event.ref == "refs/heads/master": [{name: firefox, channel: nightly}, {name: chrome, channel: dev}],
event.ref == "refs/heads/epochs/daily": [{name: firefox, channel: stable}, {name: chrome, channel: stable}, {name: webkitgtk_minibrowser, channel: stable}],
event.ref == "refs/heads/epochs/weekly": [{name: firefox, channel: beta}, {name: chrome, channel: beta}],
event.ref == "refs/heads/epochs/daily": [{name: firefox, channel: stable}, {name: chrome, channel: stable}, {name: webkitgtk_minibrowser, channel: nightly}],
event.ref == "refs/heads/epochs/weekly": [{name: firefox, channel: beta}, {name: chrome, channel: beta}, {name: webkitgtk_minibrowser, channel: stable}],
event.ref == "refs/heads/triggers/chrome_stable": [{name: chrome, channel: stable}],
event.ref == "refs/heads/triggers/chrome_beta": [{name: chrome, channel: beta}],
event.ref == "refs/heads/triggers/chrome_dev": [{name: chrome, channel: dev}],
event.ref == "refs/heads/triggers/firefox_stable": [{name: firefox, channel: stable}],
event.ref == "refs/heads/triggers/firefox_beta": [{name: firefox, channel: beta}],
event.ref == "refs/heads/triggers/firefox_nightly": [{name: firefox, channel: nightly}],
event.ref == "refs/heads/triggers/webkitgtk_minibrowser_stable": [{name: webkitgtk_minibrowser, channel: stable}]
event.ref == "refs/heads/triggers/webkitgtk_minibrowser_stable": [{name: webkitgtk_minibrowser, channel: stable}],
event.ref == "refs/heads/triggers/webkitgtk_minibrowser_nightly": [{name: webkitgtk_minibrowser, channel: nightly}]
}
each(browser):
$map:
@@ -41,6 +41,7 @@
import re
import subprocess
import sys
import tempfile
try:
from urllib2 import urlopen
except ImportError:
@@ -160,9 +161,24 @@ def install_webkitgtk_from_apt_repository(channel):
run(["sudo", "apt-get", "-qqy", "-t", "bionic-wpt-webkit-updates", "install", "webkit2gtk-driver"])


def install_webkitgtk_from_tarball_bundle(channel):
with tempfile.NamedTemporaryFile(suffix=".tar.xz") as temp_tarball:
resp = urlopen("https://webkitgtk.org/built-products/nightly/webkitgtk-nightly-build-last.tar.xz")
while True:
chunk = resp.read(16*1024)
if not chunk:
break
temp_tarball.write(chunk)
temp_tarball.flush()
run(["sudo", "tar", "xfa", temp_tarball.name, "-C", "/"])
# Install dependencies
run(["sudo", "apt-get", "-qqy", "update"])
run(["sudo", "/opt/webkitgtk/nightly/install-dependencies"])


def install_webkitgtk(channel):
if channel in ("experimental", "dev", "nightly"):
raise NotImplementedError("Still can't install from release channel: %s" % channel)
install_webkitgtk_from_tarball_bundle(channel)
elif channel in ("beta", "stable"):
install_webkitgtk_from_apt_repository(channel)
else:
@@ -4,9 +4,13 @@ FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive \
DEBCONF_NONINTERACTIVE_SEEN=true

# General requirements not in the base image
# Update and upgrade.
RUN apt-get -qqy update \
&& apt-get -qqy install \
&& apt-get -qqy upgrade


# General requirements not in the base image
RUN apt-get -qqy install \
bridge-utils \
bzip2 \
ca-certificates \
@@ -44,6 +48,16 @@ RUN apt-get -qqy install \
libindicator3-7 \
libindicator7

# To speed up runs of webkitgtk_minibrowser nightly we install all the
# dependencies needed by the bundle. This are a lot, and installing them
# at test time (instead of now) takes several minutes on taskcluster.
RUN wget https://svn.webkit.org/repository/webkit/trunk/Tools/gtk/install-dependencies \
-O /tmp/install-dependencies \
&& sed -i "s/apt-get install/apt-get -qqy install/g" /tmp/install-dependencies \
&& chmod +x /tmp/install-dependencies \
&& /tmp/install-dependencies \
&& rm -f /tmp/install-dependencies

RUN apt-get -y autoremove

RUN pip install --upgrade pip
@@ -1118,10 +1118,15 @@ def find_binary(self, venv_path=None, channel=None):
pass
# Add Debian/Ubuntu path
libexecpaths.append("/usr/lib/%s/webkit2gtk-4.0" % triplet)
if channel == "nightly":
libexecpaths.append("/opt/webkitgtk/nightly")
return find_executable("MiniBrowser", os.pathsep.join(libexecpaths))

def find_webdriver(self, channel=None):
return find_executable("WebKitWebDriver")
path = os.environ['PATH']
if channel == "nightly":
path = "%s:%s" % (path, "/opt/webkitgtk/nightly")
return find_executable("WebKitWebDriver", path)

def version(self, binary=None, webdriver_binary=None):
if binary is None:
@@ -592,14 +592,14 @@ def install(self, channel=None):

def setup_kwargs(self, kwargs):
if kwargs["binary"] is None:
binary = self.browser.find_binary()
binary = self.browser.find_binary(channel=kwargs["browser_channel"])

if binary is None:
raise WptrunError("Unable to find MiniBrowser binary")
kwargs["binary"] = binary

if kwargs["webdriver_binary"] is None:
webdriver_binary = self.browser.find_webdriver()
webdriver_binary = self.browser.find_webdriver(channel=kwargs["browser_channel"])

if webdriver_binary is None:
raise WptrunError("Unable to find WebKitWebDriver in PATH")
@@ -43,9 +43,13 @@ def test_safari_version_errors(mocked_check_output):
def test_webkitgtk_minibrowser_version(mocked_check_output):
webkitgtk_minibrowser = browser.WebKitGTKMiniBrowser(logger)

# stable version
mocked_check_output.return_value = 'WebKitGTK 2.26.1\n'
assert webkitgtk_minibrowser.version(binary='MiniBrowser') == '2.26.1'

# nightly version
mocked_check_output.return_value = 'WebKitGTK 2.27.1 (r250823)\n'
assert webkitgtk_minibrowser.version(binary='MiniBrowser') == '2.27.1 (r250823)'

@mock.patch('subprocess.check_output')
def test_webkitgtk_minibrowser_version_errors(mocked_check_output):

0 comments on commit 13594b3

Please sign in to comment.
You can’t perform that action at this time.