Open ilyazub opened 3 years ago
Try running with
bundle exec turbo_test ./spec/models/**/*_spec.rb
Also, are you using 0.1.1 which was released yesterday?
Yes, I use 0.1.1.
Thank you, it works with the explicit wildcard path.
$ bundle exec turbo_test ./spec/**/*_spec.rb
But some tests are failing that do not fail with RSpec.
turbo_test
RSpec
Just a note that glob paths are not recursive by default. I guess it's by the design of samovar
.
Default
Recursive
With the recursive glob, it opens to many connections. The limit of open files is low on my system, but this is not a problem with other gems that parallelize RSpec.
@ioquatix How to split all spec files in a number of groups equal to a number of workers like ParallelTests::Test::Runner#tests_in_groups
? I'd be happy to make a PR if you consider this is useful.
It will make one worker per processor core by default.
The glob issue is odd, it should be expanded by your shell.
Regarding the failed specs, is it because it’s using some shared state?
The glob issue was fixed after I enabled it by default in the .bashrc
.
Failed specs are for sure because of the shared state. The test was using User.last
which could be changed in some other test. I'll fix it on my side.
before :all do
@user = User.last
@search = Search.create!(user: @user, q: "expensive query", status: "Success")
end
It will make one worker per processor core by default.
I understand, but I mean executing RSpec tests in groups on each worker instead of one by one. For example, it spawns 8 workers and executes RSpec 304 times. I'm asking about spawning 8 workers and executing RSpec eight times with 38 spec files per each RSpec execution.
To rephrase, now:
bundle exec rspec spec/file_1_spec.rb # Worker 1
bundle exec rspec spec/file_2_spec.rb # Worker 5
# ...
bundle exec rspec spec/file_304_spec.rb # Worker 3
Wish:
bundle exec rspec spec/file_1_spec.rb spec/file_2_spec.rb spec/file_38_spec.rb # Worker 1
bundle exec rspec spec/file_39_spec.rb spec/file_40_spec.rb spec/file_76_spec.rb # Worker 2
# ...
bundle exec rspec spec/file_266_spec.rb spec/file_267_spec.rb spec/file_304_spec.rb # Worker 8
This could decrease test execution time when the time to load files is more than a few seconds. Haven't checked this assumption actually.
Can you check your assumption about performance? I think the execution overhead of RSpec is relatively small.
Can you check your assumption about performance? I think the execution overhead of RSpec is relatively small.
Yes, I'll check it and reply here.
turbo_test
starts execution, prints debug info, and then nothing happens. It works well if I execute only part of tests (for example,spec/models
.)I guess the problem is with tests that make external requests. I'll debug it soon, but maybe there are assumptions to check?
Full spec
turbo_test
outputrbspy
outputps
outputPart of spec files works well
turbo_test
rspec