Closed
Bug 1135874
Opened 10 years ago
Closed 9 years ago
Need some way to persist prefs from within a test between restarts
Categories
(Testing :: Firefox UI Tests, defect)
Tracking
(Not tracked)
RESOLVED
WORKSFORME
People
(Reporter: chmanchester, Unassigned)
References
Details
Attachments
(1 file)
Splitting this blocker for update tests from the discussion in bug 1129713. It seems like we need finer grained control than other consumers of mozprofile right now. If this ability is ever added there we can re-assess.
Reporter | ||
Comment 1•10 years ago
|
||
ahal had a suggestion in https://bugzilla.mozilla.org/show_bug.cgi?id=1129713#c7 I'll try adding to our prefs library.
Reporter | ||
Comment 2•10 years ago
|
||
Attachment #8568205 -
Flags: review?(hskupin)
Comment 3•10 years ago
|
||
Comment on attachment 8568205 [details] [review]
Add a function to persist prefs through restarts
r- because the test is not testing what I was talking about in the other bug. I put more details on the PR.
Attachment #8568205 -
Flags: review?(hskupin) → review-
Reporter | ||
Comment 4•10 years ago
|
||
Harness set preferences are re-enforced after a restart, so this needs a different fix.
Reporter | ||
Comment 5•10 years ago
|
||
This needs a small change to marionette automation to work. Henrik, if we were able to pass a dictionary of preferences to the call to restart to ensure they persist, would that be sufficient?
Flags: needinfo?(hskupin)
Comment 6•10 years ago
|
||
It should but how do you wanna do that? You would have to mess around with mozprofile to get that working, given that utils.js will already be present in that profile.
Flags: needinfo?(hskupin)
Reporter | ||
Comment 7•10 years ago
|
||
(In reply to Henrik Skupin (:whimboo) from comment #6)
> It should but how do you wanna do that? You would have to mess around with
> mozprofile to get that working, given that utils.js will already be present
> in that profile.
Marionette's restart machinery has a way to specify prefs that will become the new "required prefs" that are enforced after the restart. This will just be a matter of exposing that parameter to marionette.restart (it's already defined for geckoinstance.restart).
Comment 8•10 years ago
|
||
If that all works wonderful! We only have to ensure that for the next test, all the default prefs are in place again.
Reporter | ||
Comment 9•10 years ago
|
||
Comment on attachment 8568205 [details] [review]
Add a function to persist prefs through restarts
I pushed a more extensive test with the proposed behavior to the branch in the PR (it passes with the proposed marionette patch). To get back to the harness defaults after a test we can call self.marionette.enforce_gecko_prefs with the harness defaults in tearDown.
Attachment #8568205 -
Flags: review- → feedback?(hskupin)
Comment 10•10 years ago
|
||
Comment on attachment 8568205 [details] [review]
Add a function to persist prefs through restarts
I gave a couple of comments on the PR. I still don't think this is the right way to handle that. Maybe it needs a more detailed discussion first.
Attachment #8568205 -
Flags: feedback?(hskupin) → feedback-
Reporter | ||
Comment 11•10 years ago
|
||
Discussion in the PR lead us to bug 1137388. That needs to be resolved before we proceed here.
Reporter | ||
Comment 12•10 years ago
|
||
I think what we're talking about is a way to persist the override of a pref that gets set in user.js at the beginning of the test run. Marionette lets us do this with enforce_gecko_prefs, which causes a hard restart if the pref needs to be updated, and it looks like self.marionette.instance.profile.set_preferences() will let us write to a user.js file at any point.
Comment 13•10 years ago
|
||
Sounds good. Can Marionette automatically reset the value of this preferences to the one as given by the harness at the end of the test?
Reporter | ||
Comment 14•10 years ago
|
||
(In reply to Henrik Skupin (:whimboo) from comment #13)
> Sounds good. Can Marionette automatically reset the value of this
> preferences to the one as given by the harness at the end of the test?
We can implement that by calling enforce_gecko_prefs with the defaults after the test runs.
Comment 15•10 years ago
|
||
That sounds perfect.
Assignee | ||
Updated•9 years ago
|
Product: Mozilla QA → Testing
Comment 16•9 years ago
|
||
I think there is no actionable item left on this bug given that enforce_gecko_prefs() gives us what we need.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•