Replace prefs.py module with pure Marionette versions of set_pref, and get_pref

RESOLVED FIXED

Status

RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: whimboo, Assigned: nebelhom, Mentored)

Tracking

(Blocks: 1 bug)

Version 3
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [lang=py])

User Story

Marionette has its own methods for getting and setting preferences. We should make use of those, but right now would have to do some pre-work to make this possible.

prefs.py:
https://dxr.mozilla.org/mozilla-central/source/testing/puppeteer/firefox/firefox_puppeteer/api/prefs.py

get_pref():
https://dxr.mozilla.org/mozilla-central/source/testing/marionette/client/marionette_driver/marionette.py#918

set_pref():
https://dxr.mozilla.org/mozilla-central/source/testing/marionette/client/marionette_driver/marionette.py#941

clear_pref():
https://dxr.mozilla.org/mozilla-central/source/testing/marionette/client/marionette_driver/marionette.py#934

Work to do for Marionette before we can switch:

* Fx-ui tests have to be updated to explicitly clear modified preferences at the end of the test via `self.marionette.clear_pref()`, and `restore_pref()`, `restore_all_prefs()` need to be removed.

* Marionette's `get_pref()` has to support reading values from the default branch and complex values

* Marionette's set_pref() has to support setting complex values

* Wait for next Firefox version after the next ESR branch to remove prefs.py completely, and update to Marionette's `get_pref()` and `set_pref()` methods.

All those bullet points warrant their own bug so we can mostly keep this bug as tracking bug. We can file those once work gets started.

I think that this is a great project to get started with our tests, and I will support it with mentorship all the time along. It's a project which might take a while to complete, so please obey this when you are interested.

To get started make sure to read:
https://wiki.mozilla.org/User:Mjzffr/New_Contributors
Comment hidden (empty)
(Reporter)

Comment 1

2 years ago
I will mentor Johannes through this project. We might get started by next week.
Assignee: nobody → mozilla_dev
Status: NEW → ASSIGNED
(Assignee)

Comment 2

2 years ago
Hi everyone.

:whimboo thanks for making me aware of this. I'm looking forward to trying my hand at it! :)

Before we get started, I am a little unsure which guide to follow in order to set myself up. I have followed this website here:

https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/Developer_setup

With this, I was able to run tests as according to the script.

Now, I see that you gave this link:
https://wiki.mozilla.org/User:Mjzffr/New_Contributors

which points me to: http://areweeveryoneyet.org/

Could you please let me know, which setup I should use in order to start contributing?

Also, I am not too sure of the exact workflow. As you know, I only really contributed through github (apart from that one time ages ago), so I am not 100% on what to do once I decide to create a commit...

Thanks for clarifying, whimboo.

Btw. What are the days that you work late on IRC to talk with your colleagues in overseas? Because of work, I usually cannot go online before 19:00 CET.
(Reporter)

Comment 3

2 years ago
(In reply to Johannes Vogel (:nebelhom) from comment #2)
> Before we get started, I am a little unsure which guide to follow in order
> to set myself up. I have followed this website here:
> 
> https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/
> Developer_setup
> 
> With this, I was able to run tests as according to the script.
> 
> Now, I see that you gave this link:
> https://wiki.mozilla.org/User:Mjzffr/New_Contributors
> 
> which points me to: http://areweeveryoneyet.org/

Maybe Maja was not aware of the developer setup page for Marionette on MDN. Lets ni? her so we can get this page updated. Usually we point people to the new contributors page these days given that it contains all the necessary information.

> Could you please let me know, which setup I should use in order to start
> contributing?

I would assume it's mostly duplicated content. So just setup a clone of mozilla-central and you will be fine.

> Also, I am not too sure of the exact workflow. As you know, I only really
> contributed through github (apart from that one time ages ago), so I am not
> 100% on what to do once I decide to create a commit...

Ok, if you want to stay with git I could propose you git cinnabar, which I'm also using. It's a wrapper around the mercurial commands/repo which let you easily use git.

See for more details:
https://github.com/glandium/git-cinnabar

I can help when you need assistance. 

> Btw. What are the days that you work late on IRC to talk with your
> colleagues in overseas? Because of work, I usually cannot go online before
> 19:00 CET.

You should at least find Maja, but I'm also around nearly each evening. I should be back by around 8pm CET.
Flags: needinfo?(mjzffr)
(In reply to Henrik Skupin (:whimboo) from comment #3)
> (In reply to Johannes Vogel (:nebelhom) from comment #2)
> > Before we get started, I am a little unsure which guide to follow in order
> > to set myself up. I have followed this website here:
> > 
> > https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/
> > Developer_setup
> > 
> > With this, I was able to run tests as according to the script.
> > 
> > Now, I see that you gave this link:
> > https://wiki.mozilla.org/User:Mjzffr/New_Contributors
> > 
> > which points me to: http://areweeveryoneyet.org/
> 
> Maybe Maja was not aware of the developer setup page for Marionette on MDN.
> Lets ni? her so we can get this page updated. Usually we point people to the
> new contributors page these days given that it contains all the necessary
> information.
> 
> > Could you please let me know, which setup I should use in order to start
> > contributing?
> 
> I would assume it's mostly duplicated content. So just setup a clone of
> mozilla-central and you will be fine.
> 

The content is similar in many of these places, but it's aimed at different audiences and has more or less detail.

The Marionette Developer Setup page on MDN is more terse and describes all aspects of Marionette development. I created User:Mjzffr/New_Contributors as a tutorial focused specifically on Marionette Test Runner. Similarly, areweeveryoneyet.org is a brief tutorial for building Firefox (versus the detailed docs on MDN).
Flags: needinfo?(mjzffr)
(Reporter)

Updated

2 years ago
Depends on: 1303863
(Reporter)

Updated

2 years ago
Blocks: 1310632
(Reporter)

Updated

2 years ago
Blocks: 1316984
(Reporter)

Updated

2 years ago
Depends on: 1316987
(Reporter)

Comment 5

2 years ago
(Commenting on User Story)
> * Marionette's `get_pref()` has to support reading values from the default
> branch and complex values
> 
> * Marionette's set_pref() has to support setting complex values

I will take those two items and get them implemented via bug 1316984.
(Reporter)

Comment 6

2 years ago
(In reply to Henrik Skupin (:whimboo) from comment #5)
> > * Marionette's set_pref() has to support setting complex values

Looks like setting complex values isn't supported, so I left this out for my former patch which got merged to mozilla-central now. 

The remaining step to update Puppeteer and tests to use the Marionette methods for getting and setting preferences will be done via bug 1316984. So all the work we can do here is done.
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.