Closed Bug 1460914 Opened 4 years ago Closed 3 years ago

Use base profile from testing/profiles in xpcshell


(Testing :: XPCShell Harness, enhancement, P3)

Version 3


(firefox65 fixed)

Tracking Status
firefox65 --- fixed


(Reporter: ahal, Assigned: ahal)




(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.
Closed: 4 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
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
[xpcshell] Stop ignoring failures in head.js when setting prefs, r=ted
[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:

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
[xpcshell] Use nsIPrefService.readUserPrefsFromFile to set prefs, r=ted
[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/ 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 so we aren't uploading/downloading these files multiple times.
Flags: needinfo?(ahal)
See Also: → 1502449
Pushed by
[xpcshell] Use nsIPrefService.readUserPrefsFromFile to set prefs, r=ted
[xpcshell] Define preferences in testing/profiles instead of testing/xpcshell/head.js, r=ted
Keywords: leave-open
Pushed by
[mozprofile] Move mochitest's 'parseKeyValue' function into mozprofile.cli, r=ted
[xpcshell] Add --setpref to the command line, r=ted
Closed: 4 years ago3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
Duplicate of this bug: 1247136
You need to log in before you can comment on or make changes to this bug.