Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run tagged rspec tests with parallel_tests?

I want to execute my rspec tests in parallel

If I need all tests to perform on 6 cores I use bundle exec rake parallel:spec[6]

How can I specify a tag option for spec rake, e.g. --tag ~chat

like image 336
zuba Avatar asked Feb 10 '14 16:02

zuba


People also ask

How do I run a specific RSpec test?

To run a single Rspec test file, you can do: rspec spec/models/your_spec. rb to run the tests in the your_spec. rb file.

Does RSpec run tests in parallel?

Run RSpec Tests in Parallel This is “Parallel Testing”. Parallel Testing gives you the same benefits as running a multi-threaded application and helps you reduce the run time of your test suite, resulting in faster build times and faster releases.


1 Answers

Use SPEC_OPTS environment variable for passing options to rspec in this case.

Example:

$ SPEC_OPTS='--tag ~chat' bundle exec rake parallel:spec[6]
like image 192
Vitaliy Grigoruk Avatar answered Oct 04 '22 16:10

Vitaliy Grigoruk