question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to run e2e or Frontend Tests in Vagrant VM

See original GitHub issue

The Vagrant VM is not able to run either e2e or frontend tests. This is due to a couple of issues:

  • For a restarted machine, CHROME_BIN is likely to be absent
  • Chromium is not installed
  • xvfb is not installed
  • a proper environment variable for the screen for xvfb is not exported

Steps to solve this: I advise using this guide as a starting point.

  • Install Chromium on Vagrant machine
  • Install Xvfb on Vagrant machine
  • Increase default memory on VM to 2048mb to allow frontend tests to run without crashing
  • Set and export proper screen type variable for Xvfb and Chromium
  • Refactor frontend tests to change the commands they use to invoke tests if the VAGRANT environment variable returns true
  • Refactor e2e tests to properly invoke Xfvb if VAGRANT environment variable returns true
  • Figure out why Chrome/Chromium breaks when invoked by Xvfb

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:32 (32 by maintainers)

github_iconTop GitHub Comments

2reactions
bbriggscommented, Mar 16, 2016

I was able to get headless testing running on Vagrant. Some issues I noticed while doing this:

  • The VAGRANT env variable has a tendency to disappear, causing the CHROME_BIN variable to get set to an incorrect value by setup.sh.
  • To run the karma tests, we just have to add xvfb-run to the beginning of the karma command.

Currently running into a problem with e2e tests where we’re missing the webdriver-manager and protractor, both of which can be install via NPM but it seems they’re getting missed somehow.

I’m also seeing the same problem binding to ports that @MAKOSCAFEE encountered.

We’re very close to being able to solve this once and for all, I think.

0reactions
seanlipcommented, Oct 14, 2017

I’m not sure that we have many people still using Vagrant. I’m going to close this for now but if someone is reading this, is using Vagrant, and is running into this issue, please feel free to reopen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How run headless angular2 e2e tests using protractor in ...
I am running ubuntu-16.04 using Vagrant and ...
Read more >
oppia/oppia-chat - Gitter
were you thinking that we'd want to build oppia in vagrant for testing? ... e2e tests running automatically on travis, just like the...
Read more >
Just Say No to More End-to-End Tests - Google Testing Blog
Even if a product contains millions of lines of code, if a unit test fails, you only need to search that small unit...
Read more >
Troubleshooting | VVV
Use vagrant ssh to enter the VM and run the above command to test if the VM can SSH to GitHub/GitLab. If this...
Read more >
Bootstrap Kubernetes the hard way on Vagrant on Local ...
This is how we are able to perform any administrative operations on Kubernetes cluster using kubectl utility. Results: $ ls admin.crt admin.csr admin.key....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found