danksim
danksim

Reputation: 627

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"

Upvotes: 3

Views: 1839

Answers (2)

danksim
danksim

Reputation: 627

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.

Upvotes: 0

Aleksei Matiushkin
Aleksei Matiushkin

Reputation: 121000

I always used the rake task for that as advised here:

ParallelRSpec::RakeTask.new(:prspec) do |t|
  ENV['WORKERS'] = '4'
  t.rspec_opts = '--exclude-pattern "myproj/spec/home/*_spec.rb"'
end

and run it as:

bundle exec rake prspec

Upvotes: 1

Related Questions