Search code examples
rubyrspecparallel-testing

paralell_rspec with options --exclude-pattern


Trying to exclude the specs in the /home dir during the parallel run.

Tried a few things similar to the following:

parallel_rspec myproj -n 4 -o '--exclude-pattern "myproj/spec/home/*_spec.rb"'

parallel_rspec ./myproj -n 4 -o '--exclude-pattern "./myproj/spec/home/*_spec.rb"'

But it does not exclude specs in the /home dir. It runs all specs in myproj.

The following commands do exclude specs in /home dir but I need to run them in parallel:

rspec myproj --exclude-pattern "myproj/spec/home/*_spec.rb"

rspec ./myproj --exclude-pattern "./myproj/spec/home/*_spec.rb"


Solution

  • I ended up using the parallel_test gem.

    I added the following to the .rspec_parallel file:

    --tag ~tagname1
    --tag ~tagname2
    --tag ~tagname3
    

    This excluded the specs tagged with tagname1,2,3.