Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Karma is a test runner which executes JavaScript unit tests is one or more web browsers. This action runs the Karma command-line - for more information about the project and documentation on the command-line arguments, please visit the Karma website.

Name

A name for this action (this will appear within the stage action list).

Enabled

An action which is not enabled is effectively skipped when executing the given stage.

Working Directory

The directory to run the Karma command line in.

Report File(s)

A list of one or more report files to import into Continua CI - one path per line. You can use Ant patterns to match multiple files. Note that The JUnit reporter will be used and all test results will be in JUnit format.

Browsers

A list of browsers to run the Karma configuration against - one browser name per line. Leave blank to use those specified in the configuration.  Karma comes with launchers pre-installed for Chrome, Chrome-Canary, and PhantomJS. Ensure that you install any extra browsers using an NPM install action before running the Karma action.

Info
titleImportant

Note that the Continua CI agents running as a Windows service cannot run browsers which require a UI. If you really must test against one of these browsers, stop any running the agent service and run the agent as a console using the -console flag. e.g. %ProgramFiles%\VSoft Technologies\ContinuaCI Agent\Continua.Agent.Service.exe -console.

Options

Port

Specify the port that the Karma server will run on

Capture Timeout (ms)

Maximum boot-up time allowed for a browser to start and connect to Karma in milliseconds. If any browser does not get captured within the timeout, Karma will kill it and try to launch it again and, after three attempts to capture it, Karma will give up. Enter zero to use the default from the configuration file. 

Slow Test Threshold (ms)

Report tests that are slower than given time in milliseconds. Enter zero to use the default from the configuration file.

Pre-install Karma and karma-junit-reporter to working directory using NPM

Karma and the karma-junit-reporter both need to be installed to the working directory before the tests can be run. Tick this to automatically install the required files before running the Karma command line. Leave this cleared if you are installing Karma with a separate preceding NPM action

Fail action if any tests fail

Tick this to cause the build to fail if any tests fail.

Fail action if any tests error

Tick this to cause the build to fail if an error occurred while running any test

Fail action if any tests are inconclusive

Tick this to cause the build to fail if any tests are inconclusive

Timeout (in seconds)

Specify the time to wait for the Karma action to finish. If the Karma runner does not finish before the timeout then it will be terminated and the build will fail. Enter zero for no timeout. 

 

Environment Variables

Multiple environment variables can be defined - one per line. These are set before the Karma command line is run.