grosser / parallel_tests

Ruby: 2 CPUs = 2x Testing Speed for RSpec, Test::Unit and Cucumber
3.39k stars 495 forks source link

Running `rails parallel:spec[4]` does not recognize the CPU count #941

Closed Bandes closed 7 months ago

Bandes commented 7 months ago

The documentation and the code itself seems to indicate that if I add a number after the task, it will change the number of CPUs used to run the suite, but when I try this, I get errors like so:

RAILS_ENV=test rake parallel:spec[4]
zsh: no matches found: parallel:spec[4]

Without the brackets, I do not get an error, but it also doesn't limit the CPU count

RAILS_ENV=test rake parallel:spec 4
10 processes for 476 specs, ~ 47 specs per process

I would have expected at least one of these to result in 4 processes for 476 specs, ~120 specs per process (or something around 120, I didn't do the math... :) )

grosser commented 7 months ago

zsh syntax for rake is:

RAILS_ENV=test rake "parallel:spec[4]"
grosser commented 7 months ago

updated the readme to use the ugly but compatible syntax so we can avoid these in the future https://github.com/grosser/parallel_tests/pull/942