I've been looking at ways of speeding up my testing using some sort of parallel tests in combination with my current Guard setup. Guard-Hydra seemed like a good start but the Hydra gem itself is no longer maintained and the author directs people to parallel_tests instead.
Parallel tests seems very good. I got it working at the command line using the usual rake task, but I'm not capable of writing an appropriate guard extension myself. I've been rather surprised about the lack on info available when searching for 'guard parallel_tests'. Surely I'm not the only Rails developer out there with a multi-core PC who would be interested in speeding their tests up?
RSpec does not support Rails 6 built-in parallel testing.
Parallel testing is a semi-automated testing process that relies on cloud technology and virtualization to perform tests against several configurations at the same time. The goal of this process is to resolve the limitations of time and budget while still assuring quality.
Parallel testing allows teams to perform automated tests against several configurations at the same time to scale downtime and budget constraints while allowing for increased test coverage and ensuring quality.
I've implemented this option on guard-rspec
https://github.com/guard/guard-rspec/pull/150
There is now some information in the ReadMe of guard-rspec on how do to this here https://github.com/guard/guard-rspec (look right down the bottom). As of time of writing it looks like the following (note the comma's in the additional args)
rspec_options = {
cmd: "bundle exec rspec",
run_all: {
cmd: "bundle exec parallel_rspec -o '",
cmd_additional_args: "'"
}
}
guard :rspec, rspec_options do
# (...)
Actually, I looked into this recently and did not find a solution. It seems quite strange because really smart people sit around waiting for tests, when there are unused cores sitting idle.
Anyone who can come up with a solution to this would make a huge contribution to the Rails and Ruby community.
I've also implemented this option on guard-rspec:
https://github.com/guard/guard-rspec/pull/325
Also worked with multitenancy:
http://pr0d1r2.tumblr.com/post/121591540433/parallel-tests-with-multitenancy-on-guard
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With