-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a headless mode command line option #13076
Conversation
For browsers which support headless mode starting wptrunner with --headless will run the tests in headless mode; otherwise it will be ignored. --no-headless is avaiable to explicitly disable the mode when frontends change the defaults. For firefox switch the default for wpt run to be headless; for Chrome changing the default broke some smoketests, so don't switch until that is resolved. In all cases continue to run in a normal windowed mode in CI.
config_group.add_argument("--headless", action="store_true", | ||
help="Run browser in headless mode", default=None) | ||
config_group.add_argument("--no-headless", action="store_false", dest="headless", | ||
help="Don't run browser in headless mode") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we clarify what the default behaviour is in the help text?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weirdly, not easily. Becausewpt run
sets its own per-browser default. So we'd have to override the help text in that case.
Fixes #13076 and related to web-platform-tests/results-collection#603 |
Is there a bug filed for the Chrome issue? |
It's much easier to file a bug if we merge this because it gives simpler STR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Enabling by default on Firefox but not on Chrome for now seems fine (assuming you've run the tests and there's no difference on Firefox w/ and w/o headless mode).
tools/wpt/run.py
Outdated
# Allow WebRTC tests to call getUserMedia. | ||
kwargs["extra_prefs"].append("media.navigator.streams.fake=true") | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: redundant blank link?
As of [1] (merged on 2018-09-24), the WPT CLI enables the "headless" mode of Chrome and Firefox by default. This mode is more convenient for contributors running the tests from their development system, but it also relies on functionality which is not enabled during typical usage of the browsers. Results collected in this mode are therefore less authentic than results collected using a virtual display. @jgraham commented on this in [2]: > unless we have some reasonable assurance that headless mode matches > non-headless in all cases (e.g. the relevant browser running both > configurations in CI with identical results) I don't think we should > enable it for wpt.fyi-ingested runs. That issue includes evidence that the results are not equivalent, meaning "headless" mode is not appropriate for publicly documenting the capabilities of each browser. Extend the results collection system to use the new `--no-headless` command-line argument. [1] web-platform-tests/wpt#13076 [2] web-platform-tests#603
For browsers which support headless mode starting wptrunner with
--headless will run the tests in headless mode; otherwise it will be
ignored.
--no-headless is avaiable to explicitly disable the mode when
frontends change the defaults.
For firefox switch the default for wpt run to be headless; for Chrome
changing the default broke some smoketests, so don't switch until that
is resolved. In all cases continue to run in a normal windowed mode in CI.