grosser / parallel_tests

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

Running parallel tests using RSpec ignores additional spec paths in config #929

Open kiddrew opened 10 months ago

kiddrew commented 10 months ago

I'm working on an enterprise app where some high value customers have additional specs outside of the standard /spec path. We have RSpec configured to look for them using a config in rails_helper.rb

config.pattern += ',../customers/**/spec/**/*_spec.rb'

Running rspec by itself respects that configuration, but parallel_tests expects all specs to live at /spec as defined in the rspec runner:

        def default_test_folder
          "spec"
        end

The workaround for this is to specify the paths you want through the CLI:

parallel_rspec -- spec customers

You lose wildcard functionality, but it at least makes parallel_tests find all the files. IMO, running in RSpec mode should function exactly as RSpec does, which includes using RSpec's configuration.

grosser commented 10 months ago

don't think that's possible since that would mean "loading rspec and dumping the files" or loading the whole spec_helper as part of parallel_tests, which is what it tries not to do

if you can make the pattern be configured in .rspec or .parallel_rpsec config files we could maybe parse them though

kiddrew commented 9 months ago

Hmm, yeah. I get your point. Adding that config to .parallel_rspec might make sense.