Closed Bug 1572448 Opened 5 years ago Closed 5 years ago

--setpref options are not forwarded to pytestrunner

Categories

(Testing :: web-platform-tests, defect, P1)

Version 3
defect

Tracking

(firefox70 fixed)

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

Details

Attachments

(1 file, 2 obsolete files)

With bug 1350905 the --setpref command line option has been added, so that custom preferences can be specified. While this works great for wpt in general, those options sadly don't get forwarded to the pytestrunner. As result the Wd jobs completely ignore them.

This is needed for the fission jobs, which use --setpref fission.autostart=true.

The capabilities for the WebDriverProtocol and here specifically the preferences for Firefox are set at:

https://searchfox.org/mozilla-central/rev/9ae20497229225cb3fa729a787791f424ff8087b/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/firefox.py#125-127

Right now this is only for network.dns.localDomains, and nothing else. So to correctly pass-over custom preferences to Firefox, they will have to be added here.

But note that those preferences will be set when creating a session, and as such only work for those which do not need a restart of Firefox. The preference for Fission enabled would have to be set when the profile gets created, and before Firefox gets started.

So I see two ways in doing that:

  1. Having an option for geckodriver like --setpref to allow setting preferences when the profile gets created
  2. Having another pref section beside moz:firefoxOptions["prefs"] in the capabilities like forcedPrefs which would be set during profile creation

Andreas and James, what would you suggest?

Another option could be to request a FISSION environment variable which Firefox would respect. Something similar to HEADLESS.

Flags: needinfo?(james)
Flags: needinfo?(ato)

False alarm, the problem actually is that preferences as specified via --setpref on the command line are all handled as string, and trying to set set "true" for a boolean pref indeed fails.

So we need a type conversion in wptrunner when we read-in those values and cast to the right type.

Flags: needinfo?(james)
Flags: needinfo?(ato)

The extra preferences as set via --setpref will by default be of type string.
To actually set those for the browser, they will have to be stored with their
real type.

From try build:

https://taskcluster-artifacts.net/WwibeCnPREufAhq4NQ-TPg/0/public/logs/live_backing.log

[task 2019-08-08T19:05:55.609Z] + : mozharness args --test-type=wdspec '--setpref="fission.autostart=true"' --setpref=media.peerconnection.mtransport_process=false --setpref=network.process.enabled=false --allow-software-gl-layers --total-chunk=2 --this-chunk=2 --download-symbols=ondemand
[..]
[task 2019-08-08T19:09:58.136Z] 19:09:58     INFO - PID 898 | 1565291398127	webdriver::server	DEBUG	-> POST /session {"capabilities": {"alwaysMatch": {"moz:firefoxOptions": {"binary": "/builds/worker/workspace/build/application/firefox/firefox", "prefs": {"network.process.enabled": false, "fission.autostart": true, "network.dns.localDomains": "www1.xn--n8j6ds53lwwkrqhv28a.web-platform.test,xn--lve-6lad.www1.web-platform.test,[..],www2.www.not-web-platform.test", "media.peerconnection.mtransport_process": false}}}}}
Attachment #9084146 - Attachment is obsolete: true
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b880c3941ed3
[wptrunner] Forward custom preferences from --setpref WebDriverProtocol. r=webdriver-reviewers,jgraham
https://hg.mozilla.org/integration/autoland/rev/46206b874a55
[mozprofile] Cast boolean preference values case-insensitive. r=jgraham
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/18351 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Backout by aciure@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7adc0ab9aa56
Backed out changeset 46206b874a55 for causing test_preferences.py to perma fail CLOSED TREE
Attachment #9084245 - Attachment is obsolete: true

The mozprofile fix was optional and given that mozbase tests exist which check that the case remains, I just abandoned the revision.

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: