<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2018-05-16 16:52 GMT+02:00 Andrew Halberstadt <span dir="ltr"><<a href="mailto:ahalberstadt@mozilla.com" target="_blank">ahalberstadt@mozilla.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>tl;dr - You can now set prefs and<font color="rgb(28, 58, 169)"> install</font> extensions across multiple</div><div>harnesses by modifying the relevant profile under testing/profiles.</div><div><br></div></div></blockquote><div><br></div><div>This is GREAT! Thanks for doing it!<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div></div><div>If you previously would have set a  pref in:</div><div>testing/profiles/prefs_<wbr>general.js,</div><div><br></div><div>Use this instead:</div><div>testing/profiles/unittest/<wbr>user.js</div><div><br></div><div><br></div><div># Overview</div><div><br></div><div>I'm currently in the process of consolidating prefs and extensions</div><div>across all our test harnesses into a single shared location</div><div>(<a href="https://searchfox.org/mozilla-central/source/testing/profiles" target="_blank">testing/profiles</a>). If you navigate there you'll find several different</div><div>"profile-like" directories.</div><div><br></div><div>Each profile directory has a user.js file for setting prefs, and an</div><div>extensions dir for dropping in extensions. I call these directories</div><div>"profile-like" because they only currently support prefs and</div><div>extensions. Don't expect to be able to add other profile-related</div><div>files (though if there's a need, support for other kinds of profile</div><div>data can be implemented).</div><div><br></div><div>You'll also find a 'profiles.json' file, and a 'profile' utility script. The</div><div>JSON file is used to map test suites to a list of profile directories to</div><div>apply. For example, mochitest uses the 'common' and 'unittest'<br></div><div>profiles in that order. Prefs from the latter profiles will overwrite</div><div>prefs from the earlier ones. This means you can either set prefs for</div><div>a single harness (e.g by adding them to the latter profile), or set</div><div>prefs across all harnesses at the same time (e.g by adding them</div><div>to the 'common' profile). Same goes for extensions.</div><div><br></div><div>Because prefs are split across multiple directories, and those</div><div>directories can overwrite one another, the 'profile' utility script can</div><div>help you view and compare the contents of a profile. For example:</div><div><br></div><div>$ cd testing/profiles</div><div>$ ./profile show mochitest  # dumps all prefs that mochitest will use<br></div><div><br></div><div>You can also diff profiles or sort preference files alphabetically:</div><div><br></div><div>$ ./profile diff mochitest talos</div><div>$ ./profile sort mochitest</div><div><br></div><div>In the future, I may add a command to automatically set preferences</div><div>in a given list of suites.</div><div><br></div><div><br></div><div># Motivations<br></div><div><br></div><div>One great use case is testing the impact prefs and extensions have</div><div>on our performance (and unittests). Simply drop an extension into</div><div>testing/profiles/common/<wbr>extensions and push to try. It will be</div><div>installed in all of our harnesses (that use this system), including Talos.<br></div><div><br></div><div>Another reason for this change is that it provides more visibility into</div><div>which prefs are set in which harnesses. We can now diff the prefs set</div><div>in various suites to try and reason about whether those differences are</div><div>intentional or omissions.</div><div><br></div><div>Lastly, this will make it easier to set prefs. No more hunting around</div><div>the tree looking for preference files. This will help prevent cases</div><div>where a pref was accidentally omitted from a test harness.</div><div><br></div><div><br></div><div># Further Work<br></div><div><br></div><div>I'm in the middle of migrating harnesses over to this new system.</div><div>Notably, reftest and xpcshell have not yet been converted, though</div><div>hopefully these will be done soon. There is a long tail of smaller</div><div>harnesses that I might not have time to get around to however.</div><div><br></div><div>For current support, just look here:</div><div><a href="https://searchfox.org/mozilla-central/source/testing/profiles/profiles.json" target="_blank">https://searchfox.org/mozilla-<wbr>central/source/testing/<wbr>profiles/profiles.json</a><br></div><div><br></div><div>Here's the relevant bug tree:<br></div><div><a href="https://bugzilla.mozilla.org/showdependencytree.cgi?id=1451159&hide_resolved=0" target="_blank">https://bugzilla.mozilla.org/<wbr>showdependencytree.cgi?id=<wbr>1451159&hide_resolved=0</a><br></div><div><br></div><div>Let me know if you have any questions or concerns,</div><div>Andrew<br></div></div>
<br>______________________________<wbr>_________________<br>
firefox-dev mailing list<br>
<a href="mailto:firefox-dev@mozilla.org">firefox-dev@mozilla.org</a><br>
<a href="https://mail.mozilla.org/listinfo/firefox-dev" rel="noreferrer" target="_blank">https://mail.mozilla.org/<wbr>listinfo/firefox-dev</a><br>
<br></blockquote></div><br></div></div>