Open inkstak opened 11 months ago
There could be one issue around --group-by default
:
it relies on private methods from parallel_tests : https://github.com/serpapi/turbo_tests/pull/41/files#diff-36313b614b64b302e0ceec80e7a9a2dbaea194523dc46a44b7fffda7741674a5R109
I would also suggest another PR to handle properly Fuubar #23 depending on --pattern
and --exclude-pattern
.
It'll also required one of those private methods.
Hey, @ilyazub! Do you have a decision about the level of dependency on parallel_tests
? :slightly_smiling_face:
NOTE: as I know, these options belong to rspec
.
+1, this doesn't increase the dependency on parallel_tests
(although this gem is a drop-in replacement for that, so should support anyway), because --pattern
and --exclude-pattern
are RSpec flags
Any chance you could merge, @ilyazub?
FYI: --pattern
& --exclude-pattern
are both supported by RSpec & parallel_tests but they don't use the same implementation and doesn't support the same arguments.
For example, we use a CI script to launch our specs :
if parallel
command = "bundle exec parallel_rspec"
command = "bundle exec turbo_tests" if parallel == "turbo_tests"
command += " --exclude-pattern spec/system" if arg == "unit"
command += " --pattern spec/system" if arg == "system"
else
command = "bundle exec rspec"
command += " --exclude-pattern 'system/**/*_spec.rb'" if arg == "unit"
command += " --pattern 'system/**/*_spec.rb'" if arg == "system"
end
In this PR, I forward those arguments to parallel_tests so it uses its implementation and not the one from RSpec.
Because we want to support most of the ParallelTests options, may we call
ParallelTests::CLI.send(:parse_options!, @argv)
inTurboTests::CLI#run
?
PR updated ! You can pass any options supported by parallel_tests after --
:
bundle exec turbo_tests -n 4 -- --only-group 1 --pattern spec/system
Because OptionParser raises an exception on unknown options, I found it easier to split options like this.
Parallel_tests suggests the same syntax to pass test options :
parallel_rspec -- -t acceptance -f progress -- spec/foo_spec.rb spec/acceptance
Thanks for all your work on this. @ilyazub Is this close to being merged? @ilyazub looks like the changes have been addressed - are we good to merge this?
This PR add suport for some parallel_test options: