Closed Bug 1334209 Opened 5 years ago Closed 5 years ago

Activate mozharness virtualenv directly from mach commands in one-click loaners

Categories

(Testing :: General, defect)

defect
Not set
normal

Tracking

(firefox54 fixed)

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: ahal, Assigned: ahal)

Details

Attachments

(1 file)

When running the media mochitests (--subsuite=media), we install some extra dependencies in the mach command here:
https://dxr.mozilla.org/mozilla-central/source/testing/mochitest/mach_commands.py#343

But we don't install these when running them from the one-click loaner, resulting in a series of ImportErrors. We should also install this from there.
I went to try and reproduce this, and it seemed to work fine for me out of the box. I ran option 2 at the wizard prompt, then `./mach mochitest --subsuite media`. It's mozharness that sets up the websocketprocessbridge_requirements:
https://dxr.mozilla.org/mozilla-central/rev/9c06e744b1befb3a2e2fdac7414ce18220774a1d/testing/mozharness/scripts/desktop_unittest.py#312

So choosing option 2 (mozharness setup) should get these dependencies installed into the venv, and option 2 is required to run the mach command in the first place. Paul, do you remember exactly what you took when you were getting those ImportErrors?
Flags: needinfo?(padenot)
*what steps you took
(In reply to Andrew Halberstadt [:ahal] from comment #1)
> I went to try and reproduce this, and it seemed to work fine for me out of
> the box. I ran option 2 at the wizard prompt, then `./mach mochitest
> --subsuite media`. It's mozharness that sets up the
> websocketprocessbridge_requirements:
> https://dxr.mozilla.org/mozilla-central/rev/
> 9c06e744b1befb3a2e2fdac7414ce18220774a1d/testing/mozharness/scripts/
> desktop_unittest.py#312
> 
> So choosing option 2 (mozharness setup) should get these dependencies
> installed into the venv, and option 2 is required to run the mach command in
> the first place. Paul, do you remember exactly what you took when you were
> getting those ImportErrors?

I do that multiple times per day currently, and sometimes it works, sometimes it does not work, but activating the venv works. Looks like there is a race somewhere, I don't think I proceed differently when it works and does not work.
Flags: needinfo?(padenot)
Ah, so this is more about a race condition causing the virtualenv not to get activated.

The current setup where the venv is sourced by the run-wizard script is fragile. I've been meaning to get the mach bootstrap script to do this in-process anyway, this seems like a good excuse.
Summary: Automatically install mochitest media dependencies when running from a one-click loaner → Activate mozharness virtualenv directly from mach commands in one-click loaners
Comment on attachment 8832578 [details]
Bug 1334209 - Activate mozharness virtualenv in-process from one click loaner mach commands,

https://reviewboard.mozilla.org/r/108792/#review110028

rubber stamp=me
Attachment #8832578 - Flags: review?(jmaher) → review+
Assignee: nobody → ahalberstadt
Status: NEW → ASSIGNED
Pushed by ahalberstadt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d70a7e18fe84
Activate mozharness virtualenv in-process from one click loaner mach commands, r=jmaher
https://hg.mozilla.org/mozilla-central/rev/d70a7e18fe84
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.