npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mocha-pipelines

v0.0.9

Published

Parallelize your mocha tests across multiple virtual machines and/or processes

Downloads

227

Readme

mocha-pipelines

travis npm

Parallelize your mocha tests across multiple virtual machines (pipelines) and/or processes to decrease the runtime of your tests.

Install

$ npm install mocha-pipelines --save-dev

Goal

The goal of this module is to provide an easy solution for a project where running all the mocha tests has become painfully slow.

This project assumes that each test file takes about the same amount of time to run and evenly distributes the test files across separate machines and processes. If this is not the case for you, then you may want to split your tests into smaller test files or run your tests separately in multiple "suites".

For example, you could run 2 pipelines of your unit tests and 5 pipelines of your integration tests across 7 different machines, all simultaneously:

mocha-pipelines 2 1 test/unit/**/*.js
mocha-pipelines 2 2 test/unit/**/*.js

mocha-pipelines 5 1 test/integration/**/*.js
mocha-pipelines 5 2 test/integration/**/*.js
mocha-pipelines 5 3 test/integration/**/*.js
mocha-pipelines 5 4 test/integration/**/*.js
mocha-pipelines 5 5 test/integration/**/*.js

Usage

Usage: mocha-pipelines [options] <pipelines> <pipeline> [files...]

  Options:

    -h, --help           output usage information
    -V, --version        output the version number
    -p, --processes [n]  specify number of processes to use

  Example:

    Run 3 pipelines of integration tests
    (run these simultaneously on separate machines)

    mocha-pipelines 3 1 test/integration/**/*.js
    mocha-pipelines 3 2 test/integration/**/*.js
    mocha-pipelines 3 3 test/integration/**/*.js

mocha-pipelines only requires 2 arguments to get started - the total number of pipelines you are parallelizing tests across, and the pipeline number of the machine where the command is being executed.

mocha-pipelines <pipelines> <pipeline>

For example, to parallelize your tests across across 3 pipelines, you would run the following commands on 3 separate machines, simultaneously:

  • machine 1: mocha-pipelines 3 1
  • machine 2: mocha-pipelines 3 2
  • machine 3: mocha-pipelines 3 3

Using with mocha options

If you're currently running mocha with options specified on the command line, such as: $ mocha -t 5000 -R tap then move these to test/mocha.opts and mocha will automatically parse those when running mocha-pipelines with your project.

© 2015-2016 Hello Digit, Inc.