Skip to content

rsanheim/plur

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,911 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

plur

CircleCI

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.

Installation

Homebrew (macOS)

brew install rsanheim/tap/plur

Shell script (macOS / Linux)

curl -fsSL https://github.com/rsanheim/plur/raw/main/install.sh | sh

Installs 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 sh

Manual binary download

Download 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.

Quick Start

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

Supported Platforms

  • 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.

Key Features

Parallel Test Execution

plur -n 4                    # Run with specific worker count
plur                          # Run with the default 4 workers
plur --dry-run               # Preview execution plan

Rake (and Rails) Tasks

plur 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.

Explicit Framework Selection

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 tests

If there is just one framework, omit the --use flag and plur will auto-detect the framework.

Configuration

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):

  1. ~/.plur.toml
  2. .plur.toml
  3. PLUR_CONFIG_FILE (if set)

See docs/examples/ directory for more configuration examples.

Environment Variables

  • TEST_ENV_NUMBER: Worker 0 gets "", worker N gets "N+1"
  • PARALLEL_TEST_GROUPS: Total number of workers
  • PARALLEL_TEST_PROCESSORS: Compatible with parallel_tests

More information in the Documentation.

About

fast parallel test runner and watcher

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors