Closed Bug 1529000 Opened 6 years ago Closed 6 years ago

Need a way to set enviroment variables for a test folder from the manifest file

Categories

(Testing :: Mochitest, enhancement)

Version 3
enhancement
Not set
normal

Tracking

(firefox67 fixed)

RESOLVED FIXED
mozilla67
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?

Flags: needinfo?(ahal)

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

Flags: needinfo?(ahal)

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.

Attachment #9047762 - Attachment description: Bug 152900 - add a way to provide environment variables to use at startup in mochitest manifests, r=ahal. → Bug 1529000 - add a way to provide environment variables to use at startup in mochitest manifests, r=ahal.
Pushed by fqueze@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/60c03f3c8c5b add a way to provide environment variables to use at startup in mochitest manifests, r=ahal.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
Assignee: nobody → florian
Blocks: 1540135
See Also: → 1918058
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: