Skip to content

Fully fledged karma setup that can run on Ubuntu containers.

Notifications You must be signed in to change notification settings

jeanbza/git-karma-on-ubuntu-container

Repository files navigation

karma-in-docker

Run locally

  1. npm install
  2. ./node_modules/.bin/webpack
  3. open index.html

Run tests locally

  1. npm install
  2. npm test

Run tests in docker

  1. npm install

  2. npm test

  3. docker build . -t karma-docker

  4. docker run -it -v ~/workspace/git-karma-on-ubuntu-container:/karma karma-docker

  5. Run in container:

    service dbus restart
    xvfb-run chromedriver &
    cd /karma
    rm -rf node_modules
    npm install
    TEST_ENV=CI npm test
    

What are the problems this repo is trying to solve?

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

Debugging

  • Add --log-level debug to your test script in package.json to get more karma logging

  • 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)
    

About

Fully fledged karma setup that can run on Ubuntu containers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published