Karma test with SauceLabs


#1

I am trying to run karma test on SauceLabs using karma-sauce-launcher

https://circleci.com/gh/epoberezkin/ajv/32

circle.yml:

machine:
  node:
    version: 4

dependencies:
  post:
    - wget https://saucelabs.com/downloads/sc-latest-linux.tar.gz
    - tar -xzf sc-latest-linux.tar.gz

test:
  override:
    - cd sc-*-linux && ./bin/sc --user $SAUCE_USERNAME --api-key $SAUCE_ACCESS_KEY --readyfile ~/sauce_is_ready:
        background: true

    - while [ ! -e ~/sauce_is_ready ]; do sleep 1; done

    - scripts/prepare-tests
    - karma start karma.sauce.js

  post:
    - killall --wait sc  # wait for Sauce Connect to close the tunnel

All configured browsers show this error:

ERROR [launcher.sauce]: Can not start chrome
Failed to start Sauce Connect:
Sauce Connect could not establish a connection.
Please check your firewall and proxy settings.

The same happens when I start via ssh

I tried putting tunnelIdentifier (the one that sauceconnect logged) into karma.conf.js file, but it didn’t change anything:

// ...
  config.set({
    // ...
    sauceLabs: {
      testName: 'Ajv',
      connectOptions: {
        tunnelIdentifier: 'db12b5cda32d478d99f0bddd98b27d49'
      }
    },
    // ...
  });
// ...

#2