Closed Bug 1560193 Opened 5 years ago Closed 5 years ago

mach browsertime visual metrics fail with node installed globally

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(firefox-esr60 unaffected, firefox-esr68 wontfix, firefox68 wontfix, firefox69 fixed)

RESOLVED FIXED
mozilla69
Tracking Status
firefox-esr60 --- unaffected
firefox-esr68 --- wontfix
firefox68 --- wontfix
firefox69 --- fixed

People

(Reporter: barret, Assigned: barret)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

Attempting to run ./mach browsertime with a global installation of node will fail:

0:00.40 /usr/bin/nodejs /home/barret/Workspace/src/hg.mozilla.org/mozilla-central/tools/browsertime/node_modules/browsertime/bin/browsertime.js --skipHar --visualMetrics https://google.com/search?q=firefox -b firefox --firefox.binaryPath /home/barret/.local/opt/firefox-nightly/firefox --video
[2019-06-18 15:38:37] INFO: Running tests using Firefox - 3 iteration(s)
[2019-06-18 15:38:38] INFO: Testing url https://google.com/search?q=firefox iteration 1
[2019-06-18 15:38:49] ERROR: Visual Metrics failed to analyse the video Error: Command failed: python /home/barret/Workspace/src/hg.mozilla.org/mozilla-central/tools/browsertime/node_modules/browsertime/vendor/visualmetrics.py --dir /home/barret/Workspace/src/hg.mozilla.org/mozilla-central/browsertime-results/google.com-search-query-d943c9da/2019-06-18T153836-0700/pages/google.com/search/query-d943c9da/data/video/images/1 --video /home/barret/Workspace/src/hg.mozilla.org/mozilla-central/browsertime-results/google.com-search-query-d943c9da/2019-06-18T153836-0700/pages/google.com/search/query-d943c9da/data/video/1.mp4 --orange --perceptual --contentful --force --renderignore 5 --json --viewport -q 75




    at makeError (/home/barret/Workspace/src/hg.mozilla.org/mozilla-central/tools/browsertime/node_modules/browsertime/node_modules/execa/index.js:174:9)
    at /home/barret/Workspace/src/hg.mozilla.org/mozilla-central/tools/browsertime/node_modules/browsertime/node_modules/execa/index.js:278:16
    at processTicksAndRejections (internal/process/task_queues.js:89:5)
[2019-06-18 15:38:49] INFO: https://google.com/search?q=firefox BackEndTime: 358 DomInteractiveTime: 1237 DomContentLoadedTime: 1237 FirstPaint: 433 PageLoadTime: 3757

As it turns out, the global installation of python ends up being used instead of the python in the virtual environment generated in the mozilla-central checkout. This happens because to execa, the library that browsertime uses to execute processes, prepends the directory that node is in to your PATHenvironment variable, which when node is installed globally, is /usr/bin. Thus /usr/bin/python will be executed to run browsertime's visualmetrics.py instead of the virtualenv wrapped python which will fail if you do not have all the python dependencies installed globally.

We already have support in our fork of browsertime for specifying which python to use (via the PYTHON environment variable), so we can manually set this to the path of the python executable in the virtualenv.

If ./mach browsertime runs browsertime with a globally-installed node, due to
an existing bug in execa, the wrong Python will be executed. We now
specify the full path of the Python binary we wish to use (via the PYTHON
environment variable that our fork of browsertime supports) and avoid this
issue altogether.

Pushed by brennie@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d5f3bcfcd6bd
Always specify the Python executable to use when running `./mach browsertime` r=nalexander
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
No longer regressions: 1565030
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: