serpapi / turbo_tests

Run RSpec tests on multiple cores. Like parallel_tests but with incremental summarized output. Originally extracted from the Discourse and Rubygems source code.
https://rubygems.org/gems/turbo_tests
MIT License
173 stars 25 forks source link

Support passing extra options to rspec #14

Open louim opened 3 years ago

louim commented 3 years ago

I'd like to be able to use this with Guard, like it's possible with to do with parallel_rspec. However this is not currently possible with because guard passes specific options to rspec. Running guard fails with:

[1] guard(main)>
16:04:03 - INFO - Run all
16:04:03 - INFO - Running all specs
/Users/louim/.asdf/installs/ruby/2.6.8/lib/ruby/gems/2.6.0/gems/turbo_tests-1.2.4/lib/turbo_tests/cli.rb:72:in `run': invalid option: --failure-exit-code (OptionParser::InvalidOption)
    from /Users/louim/.asdf/installs/ruby/2.6.8/lib/ruby/gems/2.6.0/gems/turbo_tests-1.2.4/bin/turbo_tests:11:in `<top (required)>'
    from bin/turbo_tests:29:in `load'
    from bin/turbo_tests:29:in `<main>'
16:04:03 - ERROR - Failed: "bin/turbo_tests -f progress -r /Users/louim/.asdf/installs/ruby/2.6.8/lib/ruby/gems/2.6.0/gems/guard-rspec-4.7.3/lib/guard/rspec_formatter.rb -f Guard::RSpecFormatter --failure-exit-code 2  spec" (exit code: 1)

Because turbo_tests choke on the options passed. It would be useful to support possing down options to Rspec via a specific flag.

ilyazub commented 3 years ago

@louim Thank you, Louis!

--test-options option from parallel_tests is a great idea I overlooked. It will solve #13 too.

Steps to implement it:

Things to consider:

Help is appreciated.

OneNeptune commented 2 years ago

Would this also resolve something like passing --require spec_helper to rspec? Currently having difficulty loading require 'webmock/rspec' when running turbo_tests.

ilyazub commented 1 year ago

Would this also resolve something like passing --require spec_helper to rspec? Currently having difficulty loading require 'webmock/rspec' when running turbo_tests.

@OneNeptune Can you please provide a repository with reproduction? We use webmock/rspec without any issues.