# parallel_tests

> 2 CPUs = 2x Testing Speed for RSpec, Test::Unit and Cucumber

Source: https://talira.ai/catalog/parallel-tests-md1eyg87
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library, Command-line tool
- Categories: [developer tools / testing / parallelization](https://talira.ai/categories/developer-tools/testing/parallelization), [languages / ruby](https://talira.ai/categories/languages/ruby)
- Platforms: linux, macos, windows
- Licence: MIT
- Pricing: Free and open source
- Free tier: yes
- Self-hostable: yes
- Creator: Michael Grosser (grosser)

parallel_tests runs a Ruby test suite across all CPU cores: it splits the test files into balanced groups, by file size or by runtimes recorded from earlier runs, and runs each group in its own process with its own database (TEST_ENV_NUMBER picks it). It supports Minitest, [RSpec](https://talira.ai/catalog/rspec-87n8pes2.md), Turnip, Cucumber and Spinach, has rake tasks to create and prepare one test database per process, and can run only the files matching a pattern. The same runtime logs let CI split a suite across machines.

## Links

- GitHub: https://github.com/grosser/parallel_tests

## Problems it solves

- our RSpec suite takes 40 minutes and only uses one CPU core
- run Rails tests in parallel, each with its own test database
- split the test suite evenly across CI machines by how long each file takes
- tests clash when they run at the same time because they share one database
- make the Cucumber suite finish faster on a many-core machine
- rerun only the tests for the user model in parallel
- balance test groups so one slow group doesn't hold up the build

## Features

- groups by file size or recorded runtime
- one database per process (TEST_ENV_NUMBER)
- rake parallel:create, parallel:prepare, parallel:spec
- Minitest, RSpec, Turnip, Cucumber and Spinach
- file patterns to run a subset
- runtime loggers for even groups
- combined summary output

## Trust

Overall: 0.53 out of 1.
Signals: maintenance 0.65, adoption 0.71, momentum 0.38, community 0.93, backing 0.20, extensibility 0.00.

- last commit 23 days ago
- 8 commits in the last 90 days
- 3.5k GitHub stars
- 206 contributors
- created by Michael Grosser (grosser)
