Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit 9f0aff8

Browse files
clopezfoolip
authored andcommitted
Add webkitgtk_minibrowser runs to taskcluster daily. (#19466)
This is testing with the stable channel for now, beta or nightly channels may be integrated later. It uses a different docker image on taskcluster that is currently configured with the last stable version of WebKitGTK with experimental features enabled. When the test start in taskcluster the browser will be installed from the required channel. Enable at run-time on webkitgtk_minibrowser some features that are disabled by default. Ensure also that the required --host=127.0.0.1 argument when running in docker is automatically passed to the webdriver by the wpt runner.
1 parent a18270e commit 9f0aff8

File tree

8 files changed

+74
-37
lines changed

8 files changed

+74
-37
lines changed

.taskcluster.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ tasks:
1212
$flatten:
1313
$match: {
1414
event.ref == "refs/heads/master": [{name: firefox, channel: nightly}, {name: chrome, channel: dev}],
15-
event.ref == "refs/heads/epochs/daily": [{name: firefox, channel: stable}, {name: chrome, channel: stable}],
15+
event.ref == "refs/heads/epochs/daily": [{name: firefox, channel: stable}, {name: chrome, channel: stable}, {name: webkitgtk_minibrowser, channel: stable}],
1616
event.ref == "refs/heads/epochs/weekly": [{name: firefox, channel: beta}, {name: chrome, channel: beta}],
1717
event.ref == "refs/heads/triggers/chrome_stable": [{name: chrome, channel: stable}],
1818
event.ref == "refs/heads/triggers/chrome_beta": [{name: chrome, channel: beta}],
@@ -70,7 +70,12 @@ tasks:
7070
owner: ${event.pusher.email}
7171
source: ${event.repository.url}
7272
payload:
73-
image: harjgam/web-platform-tests:0.33
73+
image:
74+
$if: browser.name == 'webkitgtk_minibrowser'
75+
then:
76+
cl0p3z/web-platform-tests:0.1
77+
else:
78+
harjgam/web-platform-tests:0.33
7479
maxRunTime: 7200
7580
artifacts:
7681
public/results:

docs/running-tests/webkitgtk_minibrowser.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,3 @@ to run it manually you can find it on any of this paths:
1818
inside:
1919
`/usr/lib/${TRIPLET}/webkit2gtk-4.0/MiniBrowser`
2020
where `TRIPLET=$(gcc -dumpmachine)`
21-
22-
23-
Known issues:
24-
25-
* On a docker container WebKitWebDriver fails to listen on localhost,
26-
because the docker container doesn't provide an IPv6 localhost address.
27-
To workaround this issue, manually tell it to only listen on IPv4 localhost
28-
by passing this parameter to wpt run: `--webdriver-arg=--host=127.0.0.1`
29-
Example:
30-
```bash
31-
./wpt run --webdriver-arg=--host=127.0.0.1 webkitgtk_minibrowser TESTS
32-
```

tools/ci/run_tc.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,28 @@ def install_chrome(channel):
145145
run(["sudo", "apt-get", "-qqy", "update"])
146146
run(["sudo", "gdebi", "-qn", "/tmp/%s" % deb_archive])
147147

148+
def install_webkitgtk_from_apt_repository(channel):
149+
# Configure webkitgtk.org/debian repository for $channel and pin it with maximum priority
150+
run(["sudo", "apt-key", "adv", "--fetch-keys", "https://webkitgtk.org/debian/apt.key"])
151+
with open("/tmp/webkitgtk.list", "w") as f:
152+
f.write("deb [arch=amd64] https://webkitgtk.org/debian buster-wpt-webkit-updates %s\n" % channel)
153+
run(["sudo", "mv", "/tmp/webkitgtk.list", "/etc/apt/sources.list.d/"])
154+
with open("/tmp/99webkitgtk", "w") as f:
155+
f.write("Package: *\nPin: origin webkitgtk.org\nPin-Priority: 1999\n")
156+
run(["sudo", "mv", "/tmp/99webkitgtk", "/etc/apt/preferences.d/"])
157+
# Install webkit2gtk from the webkitgtk.org/debian repository for $channel
158+
run(["sudo", "apt-get", "-qqy", "update"])
159+
run(["sudo", "apt-get", "-qqy", "upgrade"])
160+
run(["sudo", "apt-get", "-qqy", "-t", "buster-wpt-webkit-updates", "install", "webkit2gtk-driver"])
161+
162+
163+
def install_webkitgtk(channel):
164+
if channel in ("experimental", "dev", "nightly"):
165+
raise NotImplementedError("Still can't install from release channel: %s" % channel)
166+
elif channel in ("beta", "stable"):
167+
install_webkitgtk_from_apt_repository(channel)
168+
else:
169+
raise ValueError("Unrecognized release channel: %s" % channel)
148170

149171
def start_xvfb():
150172
start(["sudo", "Xvfb", os.environ["DISPLAY"], "-screen", "0",
@@ -217,6 +239,9 @@ def setup_environment(args):
217239
if "chrome" in args.browser:
218240
assert args.channel is not None
219241
install_chrome(args.channel)
242+
elif "webkitgtk_minibrowser" in args.browser:
243+
assert args.channel is not None
244+
install_webkitgtk(args.channel)
220245

221246
if args.xvfb:
222247
start_xvfb()

tools/docker/Dockerfile.webkitgtk

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ FROM debian:10
77
ENV DEBIAN_FRONTEND=noninteractive \
88
DEBCONF_NONINTERACTIVE_SEEN=true
99

10-
# Install general requirements not in the base image
10+
11+
# Update and upgrade.
1112
RUN apt-get -qqy update \
12-
&& apt-get -qqy install \
13+
&& apt-get -qqy upgrade
14+
15+
# Install general requirements not in the base image
16+
RUN apt-get -qqy install \
1317
bzip2 \
1418
ca-certificates \
1519
dbus-x11 \
@@ -29,19 +33,10 @@ RUN apt-get -qqy update \
2933
xvfb \
3034
git-core
3135

32-
# Configure buster-wpt-webkit-updates repository
33-
RUN apt-key adv --fetch-keys https://webkitgtk.org/debian/apt.key
34-
RUN printf 'deb [arch=amd64] https://webkitgtk.org/debian buster-wpt-webkit-updates main' \
35-
> /etc/apt/sources.list.d/webkitgtk.list
36-
RUN printf 'Package: *\nPin: origin webkitgtk.org\nPin-Priority: 1999' \
37-
> /etc/apt/preferences.d/99webkitgtk
38-
39-
# Update and upgrade
40-
RUN apt-get update \
41-
&& apt-get -y upgrade
4236

43-
# Install webkit packages from https://webkitgtk.org/debian
44-
RUN apt-get install -y -t buster-wpt-webkit-updates webkit2gtk-driver
37+
# To speed up testers, cache in the image most of WebKitGTK dependencies
38+
# but don't install them (that will be done at test time)
39+
RUN apt-get install -qqy --download-only webkit2gtk-driver
4540

4641
# Set the timezone
4742
ENV TZ "UTC"

tools/docker/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,3 @@ To update the image used for WebKitGTK:
1515
docker build -f Dockerfile.webkitgtk -t <tag> .
1616
docker push <tag>
1717
```
18-
19-
(This image is not yet used in .taskcluster.yml.)

tools/wptrunner/wptrunner/browsers/base.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@ def cmd_arg(name, value=None):
3636
return rv
3737

3838

39+
def maybe_add_args(required_args, current_args):
40+
for required_arg in required_args:
41+
# If the arg is in the form of "variable=value", only add it if
42+
# no arg with another value for "variable" is already there.
43+
if "=" in required_arg:
44+
required_arg_prefix = "%s=" % required_arg.split("=")[0]
45+
if not any(item.startswith(required_arg_prefix) for item in current_args):
46+
current_args.append(required_arg)
47+
else:
48+
if required_arg not in current_args:
49+
current_args.append(required_arg)
50+
return current_args
51+
52+
3953
def get_free_port():
4054
"""Get a random unbound port"""
4155
while True:

tools/wptrunner/wptrunner/browsers/epiphany.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .base import get_timeout_multiplier # noqa: F401
1+
from .base import get_timeout_multiplier, maybe_add_args # noqa: F401
22
from .webkit import WebKitBrowser
33
from ..executors import executor_kwargs as base_executor_kwargs
44
from ..executors.executorwebdriver import (WebDriverTestharnessExecutor, # noqa: F401
@@ -24,9 +24,12 @@ def check_args(**kwargs):
2424

2525

2626
def browser_kwargs(test_type, run_info_data, config, **kwargs):
27+
# Workaround for https://gitlab.gnome.org/GNOME/libsoup/issues/172
28+
webdriver_required_args = ["--host=127.0.0.1"]
29+
webdriver_args = maybe_add_args(webdriver_required_args, kwargs.get("webdriver_args"))
2730
return {"binary": kwargs["binary"],
2831
"webdriver_binary": kwargs["webdriver_binary"],
29-
"webdriver_args": kwargs.get("webdriver_args")}
32+
"webdriver_args": webdriver_args}
3033

3134

3235
def capabilities(server_config, **kwargs):

tools/wptrunner/wptrunner/browsers/webkitgtk_minibrowser.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .base import get_timeout_multiplier # noqa: F401
1+
from .base import get_timeout_multiplier, maybe_add_args # noqa: F401
22
from .webkit import WebKitBrowser
33
from ..executors import executor_kwargs as base_executor_kwargs
44
from ..executors.executorwebdriver import (WebDriverTestharnessExecutor, # noqa: F401
@@ -24,16 +24,25 @@ def check_args(**kwargs):
2424

2525

2626
def browser_kwargs(test_type, run_info_data, config, **kwargs):
27+
# Workaround for https://gitlab.gnome.org/GNOME/libsoup/issues/172
28+
webdriver_required_args = ["--host=127.0.0.1"]
29+
webdriver_args = maybe_add_args(webdriver_required_args, kwargs.get("webdriver_args"))
2730
return {"binary": kwargs["binary"],
2831
"webdriver_binary": kwargs["webdriver_binary"],
29-
"webdriver_args": kwargs.get("webdriver_args")}
32+
"webdriver_args": webdriver_args}
3033

3134

3235
def capabilities(server_config, **kwargs):
36+
browser_required_args = ["--automation",
37+
"--javascript-can-open-windows-automatically=true",
38+
"--enable-xss-auditor=false",
39+
"--enable-media-capabilities=true",
40+
"--enable-encrypted-media=true",
41+
"--enable-media-stream=true",
42+
"--enable-mock-capture-devices=true",
43+
"--enable-webaudio=true"]
3344
args = kwargs.get("binary_args", [])
34-
if "--automation" not in args:
35-
args.append("--automation")
36-
45+
args = maybe_add_args(browser_required_args, args)
3746
return {
3847
"browserName": "MiniBrowser",
3948
"webkitgtk:browserOptions": {

0 commit comments

Comments
 (0)