Need a way to set enviroment variables for a test folder from the manifest file
Categories
(Testing :: Mochitest, enhancement)
Tracking
(firefox67 fixed)
Tracking | Status | |
---|---|---|
firefox67 | --- | fixed |
People
(Reporter: florian, Assigned: florian)
References
Details
Attachments
(1 file)
I would like to be able to use the profiler to identify main thread I/O done during startup in the browser/base/content/test/performance/browser_startup.js test.
I tried in https://treeherder.mozilla.org/#/jobs?repo=try&revision=ae571c1241237a7bf1c82d34f44041b25bb7f192&searchStr=OS%2CX but by the time our startupRecorder.js component (that I used to enable the profiler) is initialized, most of the startup main thread I/O has already happened.
Instead I need to enable the profiler during early startup using the MOZ_PROFILER_STARTUP environment variable.
Adding
browserEnv["MOZ_PROFILER_STARTUP"] = '1'
browserEnv["MOZ_PROFILER_STARTUP_FEATURES"] = "js,mainthreadio"
at https://searchfox.org/mozilla-central/rev/05d4b6962a571585bd679d2bbb0df0a5fb4e4eff/testing/mochitest/runtests.py#1632 gives me the expected output when I run the test locally.
Would it be possible to do for enviroment variables something similar to what was done in bug 1328830 for preferences? Or is there already a way to set environment variables for a specific folder of mochitests that I don't know about?
Comment 1•6 years ago
|
||
Would it be possible to do for enviroment variables something similar to what was done in bug 1328830 for preferences?
Yes should be possible.
Or is there already a way to set environment variables for a specific folder of mochitests that I don't know about?
No, there isn't a way to do this yet.
I'd be happy to provide guidance, but likely won't have time to work on this for awhile. If this is high priority we can loop in :jmaher and figure out where it fits and who might be able to work on it.
If you were interested in taking a stab at it, you could probably copy what the pref code does here:
https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/testing/mochitest/runtests.py#2577
Assignee | ||
Comment 2•6 years ago
|
||
Assignee | ||
Comment 3•6 years ago
|
||
Here is an example try run where I used this new feature: https://treeherder.mozilla.org/#/jobs?repo=try&revision=9e22660f0185e3e086ad75c9488d0282aee87df2
(In reply to Andrew Halberstadt [:ahal] from comment #1)
If you were interested in taking a stab at it, you could probably copy what the pref code does here:
https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/testing/mochitest/runtests.py#2577
Thanks. I tried to imitate what was done in bug 1328830 for preferences. What I have worked well enough that I could continue my experiment and uncover bugs on the C++ side (so I don't expect to land a test using this before I get these bugs fixed).
It looks like I should add something to testing/mochitest/tests/python/test_basic_mochitest_plain.py but I haven't managed to quickly figure out how to run that test locally.
Updated•6 years ago
|
Comment 5•6 years ago
|
||
bugherder |
Updated•6 years ago
|
Description
•