Running Sandstorm's browser tests

Skip to first unread message

Troy Farrell

Dec 15, 2020, 10:41:08 AM12/15/20
to Sandstorm Development
Since I've been working on, I've
been trying to get the in-browser tests working.  I haven't succeeded yet.  Perhaps you can help.  Here's what I've done, using a vagrant-spk VM:

vagrant@localhost:~$ lsb_release -a
No LSB modules are available.
Distributor ID:    Debian
Description:    Debian GNU/Linux 9.13 (stretch)
Release:    9.13
Codename:    stretch
vagrant@localhost:~$ sudo apt install build-essential libcap-dev xz-utils zip unzip strace curl discount git python zlib1g-dev golang-go cmake strace
vagrant@localhost:~$ curl | sh
vagrant@localhost:~$ git clone
vagrant@localhost:~$ cd sandstorm/
vagrant@localhost:~/sandstorm$ make bundle
vagrant@localhost:~/sandstorm$ make test
tests/ sandstorm-0-fast.tar.xz test-app.spk
Couldn't find executable 'firefox' - try installing the firefox package?
Makefile:167: recipe for target 'test' failed
make: *** [test] Error 1
vagrant@localhost:~/sandstorm$ sudo apt install firefox-esr default-jre-headless xvfb
vagrant@localhost:~/sandstorm$ make test

At this point, the test fails with a generic error.  So I ran the command I found in Makefile:

vagrant@localhost:~/sandstorm$ bash tests/ sandstorm-0-fast.tar.xz test-app.spk

This also fails.  Reading tests/, I figure that I need this:

vagrant@localhost:~/sandstorm$ cd tests
vagrant@localhost:~/sandstorm/tests$ xvfb-run --server-args="-screen 0, 1280x1024x24" node_modules/.bin/selenium-standalone start &
vagrant@localhost:~/sandstorm/tests$ tmp-sandstorm/sandstorm start
vagrant@localhost:~/sandstorm/tests$ bash ../

This gives me the path /home/vagrant/.meteor/packages/meteor-tool/.1.11.1.pnhw2i.xi5lh++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle.  Next, I can run the tests with npm test.

vagrant@localhost:~/sandstorm/tests$ /home/vagrant/.meteor/packages/meteor-tool/.1.11.1.pnhw2i.xi5lh++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/npm test

This fails because it cannot find Chrome.  Why did we install Firefox?

vagrant@localhost:~/sandstorm/tests$ sudo apt install chromium chromiumdriver
vagrant@localhost:~/sandstorm/tests$ /home/vagrant/.meteor/packages/meteor-tool/.1.11.1.pnhw2i.xi5lh++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/npm test

Fails.  "This version of ChromeDriver only supports Chrome version 87".  Where is my eye roll emoji?  Let's replace the chromedriver binary with the one apt installed.

vagrant@localhost:~/sandstorm/tests$ find . -name chromedriver -type d
vagrant@localhost:~/sandstorm/tests$ cd node_modules/selenium-standalone/.selenium/chromedriver
vagrant@localhost:~/sandstorm/tests/node_modules/selenium-standalone/.selenium/chromedriver$ ls
vagrant@localhost:~/sandstorm/tests/node_modules/selenium-standalone/.selenium/chromedriver$ mv latest-x64-chromedriver
vagrant@localhost:~/sandstorm/tests/node_modules/selenium-standalone/.selenium/chromedriver$ which chromedriver
vagrant@localhost:~/sandstorm/tests/node_modules/selenium-standalone/.selenium/chromedriver$ ln -s /usr/bin/chromedriver latest-x64-chromedriver
vagrant@localhost:~/sandstorm/tests/node_modules/selenium-standalone/.selenium/chromedriver$ cd ~/sandstorm/tests
vagrant@localhost:~/sandstorm/tests$ /home/vagrant/.meteor/packages/meteor-tool/.1.11.1.pnhw2i.xi5lh++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/npm test

Success!  "TEST FAILURE:  22 assertions failed, 0 passed. (1m 59s)"  At least they ran!  I've attached the test output as sandstorm-tests-failing-1.txt.

I haven't solved the test failures yet.  Let me know if I'm doing something wrong.  It should not be this hard to run the test suite.


Troy Farrell

Dec 15, 2020, 1:11:27 PM12/15/20
to Sandstorm Development
I think that I've solved the riddle.  It occurred to me that the loginDevAccountFast function would only be present when Sandstorm is in development mode, so if it is missing, the tests are not connecting to a development server.  I looked at the test code to see how the tests find the server and realized that I needed to export LAUNCH_URL=  Now most of the tests pass.  I've attached my current test results.

Ian Denhardt

Dec 15, 2020, 3:32:43 PM12/15/20
to Sandstorm Development, Troy Farrell
Glad you figured it out. The log you attached looks similar to the
failures on master:

...Unfortunately some time between shutting the old Jenkins setup run
by box that Sandstorm INC and (years later) setting up CI with GitHub
actions, some failures snuk in, and we haven't managed to fix all of
them yet (it looks like we've actually backslid a bit; we should
probably try to find a way to mark tests as "expected to fail" so we
don't have to remember to check whether the tests failing in CI are the
ones we expect).

But in any case, looks like you're all set up.

Happy hacking,


Quoting Troy Farrell (2020-12-15 13:11:27)
> --
> You received this message because you are subscribed to the Google
> Groups "Sandstorm Development" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [1]
> To view this discussion on the web visit
> [2]
> Verweise
> 1.
> 2.
Reply all
Reply to author
0 new messages