plur is a fast, parallel, drop-in test runner and watcher primarily targeting Ruby and Rails using RSpec or Minitest. Its written in Go, so just a single binary to install, once, and use across all projects.
brew install rsanheim/tap/plurcurl -fsSL https://github.com/rsanheim/plur/raw/main/install.sh | shInstalls the latest release to ~/.local/bin by default. If that directory doesn't exist, it uses /usr/local/bin when that's present and writable, otherwise it creates ~/.local/bin. Pin a version or change the destination (PLUR_INSTALL_PATH) with environment variables:
curl -fsSL https://github.com/rsanheim/plur/raw/main/install.sh | PLUR_VERSION=v0.60.0 shDownload the latest release for your platform from GitHub Releases, extract, and put the plur binary somewhere on your PATH.
See Getting Started for first-run details.
cd my-rails-project
plur -n 4 --dry-run # preview what would run (no actual test execution)
plur -n 4 # run tests across four cores
plur # run tests with the default 4 workers
plur watch # watch for changes and run tests automatically- macOS ARM64 (Apple Silicon)
- Linux x86_64
- Linux ARM64
- Experimental Windows x86_64
Watch mode (plur watch) will install platform-specific binaries on first use.
plur -n 4 # Run with specific worker count
plur # Run with the default 4 workers
plur --dry-run # Preview execution planplur rails db:create -n 3 # Create databases in parallel
plur rails db:migrate -n 3 # Run migrations across all DBs
plur rails db:prepare -n 3 # Prepare all DBs
plur rake db:setup -n 3 # Run a Rake task once per worker
plur rake db:create db:migrate -n 3 # Run multiple Rake tasks per worker
plur rake -n 1 -- --tasks # Pass Rake-specific flags after --plur rails <args> and plur rake <args> run the configured command once per worker with PARALLEL_TEST_GROUPS and TEST_ENV_NUMBER set. Arguments are appended literally; put Plur flags like -n before --, and use -- to pass flags through to Rails/Rake.
For projects where you have both rspec and minitest tests, you can explicitly select the framework you want to use.
plur --use=rspec # Run RSpec tests explicitly
plur --use=minitest # Run Minitest testsIf there is just one framework, omit the --use flag and plur will auto-detect the framework.
Plur supports TOML configuration files for persistent settings:
# .plur.toml or ~/.plur.toml
workers = 4
[job.rspec]
cmd = ["bin/rspec"]
[[watch]]
name = "lib-to-spec"
source = "lib/**/*.rb"
targets = ["spec/{{match}}_spec.rb"]
jobs = ["rspec"]Config files load in this order (later files override earlier values):
~/.plur.toml.plur.tomlPLUR_CONFIG_FILE(if set)
See docs/examples/ directory for more configuration examples.
TEST_ENV_NUMBER: Worker 0 gets"", worker N gets"N+1"PARALLEL_TEST_GROUPS: Total number of workersPARALLEL_TEST_PROCESSORS: Compatible with parallel_tests
More information in the Documentation.