Guard vs autotest (sinatra)

Hello,

Which way to watch for file changes and launch rspec is faster, guard or
autotest?

My toolchain is vim + tmuxinator (tmux configuration utility). Once I
launch ‘tmuxinator’ I have a vanilla window (browsing/running vim
usually) another one runs foreman or thin (depends), a third one who run
‘irb’ to get access to models (much like rails console) and a last one
running ‘autotest’. My OS is MacOSX.

I’m using rspec 3.0.3 now. When I ‘save’ a file with vim, I have to wait
for at leas 3-5 seconds before all tests are finished and I have only 7
now! Is there a way make testing faster? (like 0.3-5 seconds?!). Now I’m
monitoring file changes via ‘autotest-fsevent’.

I installed ‘Spork’ which is supposed to be faster, but doesn’t play
well with autotest. When I launch ‘spork’, rspec (with --drb option)
sends the test to the drb server (running on yet another tmux window)
but I don’t get any notifications and autotest fails to run, growl comes
up with an error notification.

I’m thinking of guard now, but the guard configuration seems to be hard
to configure. I never used ‘guard’ for anything, so I’m not familiar
with it. Does anyone know if I’ll get any speed out of it if I switch
from autotest to guard? Anyone here using guard/spork with Sinatra?

Thanks,

Panagiotis (atmosx) Atmatzidis

email: [email protected]
URL: http://www.convalesco.org
GnuPG ID: 0x1A7BFEC5
gpg --keyserver pgp.mit.edu --recv-keys 1A7BFEC5

“As you set out for Ithaca, hope the voyage is a long one, full of
adventure, full of discovery […]” - C. P. Cavafy

On Oct 30, 2014, at 12:10, Panagiotis A. [email protected]
wrote:

I’m using rspec 3.0.3 now. When I ‘save’ a file with vim, I have to wait for at
leas 3-5 seconds before all tests are finished and I have only 7 now! Is there a
way make testing faster? (like 0.3-5 seconds?!). Now I’m monitoring file changes
via ‘autotest-fsevent’.

How long does a normal run (ie, rake or rspec spec) take on average?

The only thing autotest-fsevent will do is make scanning the filesystem
cheaper (eg, battery drain). I don’t know if it’ll trigger an event the
instant a file is updated. If that is true, then you might want to tweak
your sleep interval as it defaults to 1 second.

P.S. filing an issue is a better way to get targeted support.

The holy rubygem called rerun, use it to hold your web server in
developing… that is great

2014-10-31 8:11 GMT+08:00 Panagiotis A. [email protected]:

Hello,

On 30 Οκτ 2014, at 21:20 , Ryan D. [email protected] wrote:

On Oct 30, 2014, at 12:10, Panagiotis A. [email protected] wrote:

I’m using rspec 3.0.3 now. When I ‘save’ a file with vim, I have to wait for at
leas 3-5 seconds before all tests are finished and I have only 7 now! Is there a
way make testing faster? (like 0.3-5 seconds?!). Now I’m monitoring file changes
via ‘autotest-fsevent’.

How long does a normal run (ie, rake or rspec spec) take on average?

$ time rspec

Finished in 0.58307 seconds (files took 1.56 seconds to load)
7 examples, 0 failures
rspec 2,34s user 0,30s system 98% cpu 2,666 total

$ time rspec --drb
rspec --drb 0,52s user 0,08s system 36% cpu 1,659 total

rspec forwarding the message to sprock is way faster.

The only thing autotest-fsevent will do is make scanning the filesystem cheaper
(eg, battery drain). I don’t know if it’ll trigger an event the instant a file is
updated.

I see, so it’s better to for me to try to implement guard somehow.

If that is true, then you might want to tweak your sleep interval as it defaults
to 1 second.

Ah thanks fot the tip, I will take a closer look at this!

P.S. filing an issue is a better way to get targeted support.

Good, I’ll take a look at doc/code first and see how it goes.

Thanks!

Panagiotis (atmosx) Atmatzidis

email: [email protected]
URL: http://www.convalesco.org
GnuPG ID: 0x1A7BFEC5
gpg --keyserver pgp.mit.edu --recv-keys 1A7BFEC5

“As you set out for Ithaca, hope the voyage is a long one, full of
adventure, full of discovery […]” - C. P. Cavafy