Closed Bug 1460914 Opened 6 years ago Closed 6 years ago

Use base profile from testing/profiles in xpcshell

Categories

(Testing :: XPCShell Harness, enhancement, P3)

Version 3
enhancement

Tracking

(firefox65 fixed)

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: ahal, Assigned: ahal)

References

Details

Attachments

(6 files)

Follow up work from bug 1451159. This will move xpcshell preferences into the new testing/profiles system.
Priority: -- → P3
I was looking into this briefly, and xpcshell doesn't even use mozprofile. I guess the xpcshell binary doesn't read profile directories like Firefox does, so there's nothing to do here.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
We want to run xpcshell with a special pref in bug 1470266. Normally this would be done by defining a special variable in the xpcshell command that head.js would then use to call Services.prefs.setCharPref(...). However, this adds more and more logic to head.js every time we have to do something like this. Let's pass in a prefs file via the xpcshell command line instead and set everything in that file. This will allow us to define prefs in `testing/profiles/xpcshell` instead of hardcoding them in head.js. I'll also implement a --setpref option.
Assignee: nobody → ahal
Blocks: 1470266
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
If something goes wrong when setting prefs, that's something we'll want to know about as it likely means some tests will start to fail.
The current command line building is hard to follow and make sense of. Let's just use a single command variable and comment the order it needs. Depends on D9549
Keywords: leave-open
Pushed by ahalberstadt@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ab0947533e9a [xpcshell] Stop ignoring failures in head.js when setting prefs, r=ted https://hg.mozilla.org/integration/autoland/rev/9688858bc5da [xpcshell] Cleanup code to build the xpcshell command, r=ted
Filed a follow-up to further simplify the command logic, bug 1501669.
This uses nsIPrefService.readUserPrefsFromFile to set preferences from a user.js passed in via the python harness. This allows us to use the profiles under testing/profiles like all the other harnesses and will make setting prefs in xpcshell easier to use and understand.
This commit creates an empty 'base' profile because I wanted to preserve the ability to apply a pref to all test harnesses on try. Since xpcshell doesn't share many prefs with the other harnesses, it can't use the common profile. So adding a pref to 'common' will apply it everywhere except xpcshell. Adding a pref to 'base' will apply it everywhere including xpcshell. These profiles are starting to get a bit messy, but I'd like to punt re-organizing them to a follow-up bug. Depends on D9716
Parsing prefs and env on the command line is a common task performed by our harnesses, let's move it into mozbase. Depends on D9717
Fyi that is the last of the patches in this series. Here's a new try run with 3 retriggers for each task: https://treeherder.mozilla.org/#/jobs?repo=try&revision=8593dbe58db2a9762a376823f100cacd4c817522 The Win10 xpcshell tasks (especially opt) fail very frequently on mozilla-central, so I expect a bunch of orange there.
Not sure what those Android build bustages are, but I can't see how they'd be related to this patch.
Pushed by ahalberstadt@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9e438c55a248 [xpcshell] Use nsIPrefService.readUserPrefsFromFile to set prefs, r=ted https://hg.mozilla.org/integration/autoland/rev/a2161aab4e4e [xpcshell] Define preferences in testing/profiles instead of testing/xpcshell/head.js, r=ted
Oops, forgot to add "base/*" to the profile_files list in testing/profiles/moz.build. Xpcshell didn't fail because it gets packaged from the srcdir anyway (mochitest, reftest, et al grab it from the objdir). I'll file a follow-up bug so stop copying testing/profiles to the objdir. Like :ted mentioned in one of his review comments, when running locally harnesses should just be able to find it in the srcdir, and in CI we can copy it to the test archive straight from the srcdir as well. We should also archive them in a single place in tests.common.zip so we aren't uploading/downloading these files multiple times.
Flags: needinfo?(ahal)
Pushed by ahalberstadt@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1ba93cd55330 [xpcshell] Use nsIPrefService.readUserPrefsFromFile to set prefs, r=ted https://hg.mozilla.org/integration/autoland/rev/20a550cfc08f [xpcshell] Define preferences in testing/profiles instead of testing/xpcshell/head.js, r=ted
Keywords: leave-open
Pushed by ahalberstadt@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f99b45112279 [mozprofile] Move mochitest's 'parseKeyValue' function into mozprofile.cli, r=ted https://hg.mozilla.org/integration/autoland/rev/531299c96e09 [xpcshell] Add --setpref to the command line, r=ted
Status: REOPENED → RESOLVED
Closed: 6 years ago6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: