Is it possible use Guard in combination with parallel tests?
Asked Answered
P

4

8

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?

Picaresque answered 20/11, 2012 at 9:49 Comment(0)
E
8

I've implemented this option on guard-rspec

https://github.com/guard/guard-rspec/pull/150

Embarrassment answered 15/1, 2013 at 5:26 Comment(1)
Hi Rafael. I tested it and it worked fine. Much, much faster! Hope it gets merged in.Picaresque
U
4

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
# (...)
Ultramicrometer answered 13/3, 2016 at 19:16 Comment(0)
F
1

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.

Fiesta answered 21/11, 2012 at 14:40 Comment(0)
A
1

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

Agile answered 15/6, 2015 at 14:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.