tox -e npm fails to start Chrome
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Dashboard (Horizon) |
Fix Released
|
Low
|
Jack Choy |
Bug Description
When running 'tox -e npm' on Ubuntu, Chrome fails to start with the following error:
19 04 2017 16:34:15.249:INFO [karma]: Karma v1.1.2 server started at http://
19 04 2017 16:34:15.251:INFO [launcher]: Launching browser Chrome with unlimited concurrency
19 04 2017 16:34:15.261:INFO [launcher]: Starting browser Chrome
19 04 2017 16:34:15.461:ERROR [launcher]: Cannot start Chrome
19 04 2017 16:34:15.468:INFO [launcher]: Trying to start Chrome again (1/2).
19 04 2017 16:34:15.809:ERROR [launcher]: Cannot start Chrome
19 04 2017 16:34:15.810:INFO [launcher]: Trying to start Chrome again (2/2).
19 04 2017 16:34:16.415:ERROR [launcher]: Cannot start Chrome
19 04 2017 16:34:16.416:ERROR [launcher]: Chrome failed 2 times (cannot start). Giving up.
If you revise the [testenv:npm] rule to start chrome first, you'll see why it failed:
grep: write error
mkdir: cannot create directory ‘/.local’: Permission denied
touch: cannot touch ‘/.local/
[7633:7633:
Obviously, the permission denied error is valid in that you shouldn't be able to create a directory off of root. What's missing is the $HOME preceding the directory name.
The second problem is due to an unset DISPLAY variable needed when running this in *nix environments.
This tells me Chrome needs at least $HOME and $DISPLAY, but it is not set because tox only passes the PATH variable in *nix environments as mentioned in http://
To fix this, we can add the following lines to the [testenv:npm] section:
passenv =
HOME
DISPLAY
Changed in horizon: | |
assignee: | nobody → Jack Choy (jack.likes.to.code) |
Changed in horizon: | |
status: | New → In Progress |
Changed in horizon: | |
milestone: | none → pike-2 |
importance: | Undecided → Low |
Reviewed: https:/ /review. openstack. org/459418 /git.openstack. org/cgit/ openstack/ horizon/ commit/ ?id=989e10e7a5e 6d81a961fffe973 330e0251961c4d
Committed: https:/
Submitter: Jenkins
Branch: master
commit 989e10e7a5e6d81 a961fffe973330e 0251961c4d
Author: Jack Choy <email address hidden>
Date: Thu Apr 20 16:37:49 2017 -0700
Allow Chrome to start when tox is running npm
Chrome in *nix environments requires the HOME and DISPLAY variables
to be set for Chrome to start properlyi when running the 'npm' rule.
The HOME variable is needed so Chrome can load up the user's
preferences. The DISPLAY variable is needed so it know what display
to launch Chrome into.
Change-Id: I84f4d1d47f0651 58e8f5bf5691c24 1061cc16aab
Closes-Bug: #1684321