Closed Bug 1672983 Opened 6 years ago Closed 6 years ago

Support --setenv command line argument in browsertime

Categories

(Testing :: Raptor, task, P3)

task

Tracking

(firefox84 fixed)

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: sparky, Assigned: kanishk509, Mentored)

References

Details

(Keywords: good-first-bug, Whiteboard: [lang=py])

User Story

See here for information on how to contribute: https://wiki.mozilla.org/TestEngineering/Performance/NewContributors

Attachments

(1 external file)

+++ This bug was initially created as a clone of Bug #1494669 +++

We need to add the ability to use --setenv to raptor-browsertime. We already have the cli arguments we just need to hook it up. This will involve modifying browsertime as well since it doesn't accept settings for the environment.

I would like to work on this. Can you share some details?

Flags: needinfo?(gmierz2)

Awesome! :)

So you'll have to start by hacking in browsertime. This will involve adding a new command line option to it: https://github.com/sitespeedio/browsertime/blob/main/lib/support/cli.js

Next, you'll need to take those values and set them for the process env in the following file (in a similar way to this code): https://github.com/sitespeedio/browsertime/blob/51e30a4d768fe94d78bbffe691a59d17b2358588/lib/firefox/webdriver/builder.js#L54-L57

To test this out locally. You can run ./mach browsertime --update-upstream-url https://github.com/sitespeedio/browsertime/tarball/51e30a4d768fe94d78bbffe691a59d17b2358588

Then, ./mach browsertime --setup --clobber

After that, you'll be able to use it in Raptor-Browsertime to test it out: https://searchfox.org/mozilla-central/source/testing/raptor/raptor/browsertime/base.py#172

You could use the same command as in the previous bug to test this out, but be sure to add the option: --browsertime

Let me know if you have any questions or hit any issues here! For the browsertime patch, you can flag myself and soulgalore to review the patch.

Flags: needinfo?(gmierz2)

:sparky, there seems to be an option to set firefox env variables in browsertime already.

See https://github.com/sitespeedio/browsertime/pull/1110/commits/42cc5d55702c5406abd0f9ab24e4b17dd7dfaa21 and https://bugzilla.mozilla.org/show_bug.cgi?id=1607960.

Stuff like --firefox.env='MOZ_LOG=nsHttp:5' seems to be working.

Can we use this option directly from raptor-browsertime?

Flags: needinfo?(gmierz2)

Oh that's excellent! I missed that it was already there, thanks for checking.

Yup, we can use that option directly in raptor-browsertime.

Flags: needinfo?(gmierz2)
Assignee: nobody → kanishk509
Status: NEW → ASSIGNED

Submitted an initial patch.
I'm setting up browsertime to test it locally, will update after I test it with ./mach raptor --browsertime -t raptor-tp6-amazon-firefox --setenv MOZ_LOG=timestamp,all --verbose.

Tested locally with ./mach raptor --browsertime -t raptor-tp6-amazon-firefox --setenv MOZ_LOG=timestamp,nsHttp:5,cache2:5,nsSocketTransport:5,nsHostResolver:5 --verbose.
Env variables are being passed properly. I can see in the console:

[browsertime] Running with options: {
...
15:05:16     INFO -  raptor-browsertime Info:   "firefox": {
...
15:05:16     INFO -  raptor-browsertime Info:     "env": "MOZ_LOG=timestamp,nsHttp:5,cache2:5,nsSocketTransport:5,nsHostResolver:5"

Lots of logs also being printed.

Pushed by gmierz2@outlook.com: https://hg.mozilla.org/integration/autoland/rev/03698522340e Support --setenv command line argument in raptor-browsertime. r=sparky,perftest-reviewers

Nice work getting --setenv working across Raptor Kanishk!

Would you like another bug to hack on?

Flags: needinfo?(kanishk509)
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch

(In reply to Greg Mierzwinski [:sparky] from comment #9)

Nice work getting --setenv working across Raptor Kanishk!

Thanks for the help! This was fun.

Would you like another bug to hack on?

Yeah, would love to pick up something new.

Flags: needinfo?(kanishk509)

Great! :)

We recently opened this one if you're interested? https://bugzilla.mozilla.org/show_bug.cgi?id=1674442
There would be a follow-up on that one to (which could be done at the same time) where we will need to pull in the tags from the browsertime test tasks into the vismet tasks (like what we do for the extraOptions).

Flags: needinfo?(kanishk509)

(In reply to Greg Mierzwinski [:sparky] from comment #12)

Great! :)

We recently opened this one if you're interested? https://bugzilla.mozilla.org/show_bug.cgi?id=1674442
There would be a follow-up on that one to (which could be done at the same time) where we will need to pull in the tags from the browsertime test tasks into the vismet tasks (like what we do for the extraOptions).

I'll definitely try to give it a go as soon as I'm able to, if it hasn't been picked up by then.

Flags: needinfo?(kanishk509)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: