npm install
./node_modules/.bin/webpack
open index.html
npm install
npm test
-
npm install
-
npm test
-
docker build . -t karma-docker
-
docker run -it -v ~/workspace/git-karma-on-ubuntu-container:/karma karma-docker
-
Run in container:
service dbus restart xvfb-run chromedriver & cd /karma rm -rf node_modules npm install TEST_ENV=CI npm test
- Provide a basic karma + babel + react example that runs on docker containers
- The karma-chrome-launcher hangs trying to start google-chrome (it does so directly; not through
chromedriver
). We don't know why this is - even with maximum logging (see below) we get no useful information - Running
google-chrome
through the karma-script-launcher hangs - again, we were unable to find out why. We think this and the karma-chrome-launcher is related to Karma's use of child_process.spawn [1] [2] [3] - We know that chromedriver + acceptance tests work headlessly in a very similar container (again - the only different we see is that karma-chrome-launcher and co get run as a separate process via child_process.spawn)
So...
Our solution is to start chromedriver in its own thread and use the karma-script-launcher JUST to make chromedriver (who is not living in the child_process.spawn process) navigate to the page that karma passes to our script
-
Add
--log-level debug
to yourtest
script inpackage.json
to get more karma logging- Karma suppresses the output of launchers (so you can not see why google-chrome is failing!)]
-
chromedriver --verbose
is a good source of information -
Karma doesn't print the output of your launcher (chrome, script, firefox, whatever) because of this piece of code. This doesn't seem to be configurable. You can replace that bit of code with:
var spawnWithoutOutput = function () { var proc = spawn.apply(null, arguments) proc.stdout.pipe(process.stdout) proc.stderr.pipe(process.stderr) return proc } ProcessLauncher.call(launcher, spawnWithoutOutput, require('../temp_dir'), timer)