RSpec
bundle add selective-ruby-rspecbundle exec selective rspecselective rspec is a drop-in replacement for rspec. Every RSpec flag, file argument and tag filter is forwarded, so whatever your CI passed to rspec before can be passed unchanged:
bundle exec selective rspec spec/models spec/services --tag ~slowWhat changes is where the examples come from. Instead of running everything it can see, the runner reports the examples it found to Selective and then runs whichever ones Selective hands it, in the order Selective chooses. On a node with nothing left to do, the command exits once the queue is empty.
Runner flags
Section titled “Runner flags”Two flags belong to Selective rather than RSpec:
| Flag | Effect |
|---|---|
--debug | Verbose output about the connection and the work the node is given. Ask for this in bug reports. |
--log | Write the runner’s log to a file. |
Platforms
Section titled “Platforms”The gem ships a native transport binary for x86_64-linux, aarch64-linux, x86_64-darwin and arm64-darwin. If CI reports Unable to find executable for <platform>, add the platform to your lockfile:
bundle lock --add-platform x86_64-linuxThe tracer extension
Section titled “The tracer extension”Installing the gem builds selective_tracer, a small native extension used to record which files each example executes. That needs make and a C compiler. If the build fails, installation still succeeds and the runner works normally; the only thing it can’t do is record a test map. See Test selection.
Formatters and JUnit output
Section titled “Formatters and JUnit output”Your configured RSpec formatters run as usual on each node, so per-node JUnit or JSON output keeps working. The combined view across nodes is the Selective dashboard.