Spork repeatedly retries failed tests in autotest

I have a new project that I am trying to start and run using rspec, autotest and spork.

I use:

  • rails 3.0.4

  • rspec 2.5.0

  • spork 0.9.0.rc3

  • autotest 4.4.6

It seems that Spork is loading fine (I get a message that it is listening on a port), but when I run an autotest with a failed test, it runs this test again and again. It should just run the test, see that it does not work and stops. Any idea why this behavior is happening?

In addition, as soon as I make the failed tests pass, the autotest stops as it should. If I then make changes to the code, the tests do not run, and I need Ctrl-C for the autotest to see the changes.

Thanks for any help!

+2
source share
1 answer

Are you sure this is due to spork? I just fixed a similar problem with the autotest and the infinite loop, where some components (simple in this case) kept updating the files in the directory, and the autotest selected them as mutable and, therefore, repeated the tests. To solve the problem, find out if spork writes to any file / directory in your tree and adds this to the exclusion list for autotest, for example:

~/ruby/project$ cat .autotest
Autotest.add_hook :initialize do |at|
  at.add_exception(%r{^\./\.git})
  at.add_exception(%r{^\./your_culprit})
end

Perhaps a github doc makes it more comprehensible.
Hope this helps

+2
source

All Articles