autotest freaking out? Try -v and nuke the extras

| | Comments (2)

I just had a bug on autotest get diagnosed by the filer:

"The root cause is that I have "require 'turn'" in my project (which provides prettier Test::Unit output) but Autotest::handleresults isn't designed to parse turn's output."_

This was an advanced issue caused by turn (I do hope he files a bug against turn), and solved simply be removing it.

I've seen much simpler issues that can be nearly as confusing. For example, several projects I've worked on that generated thumbnails or index files in RAILS_ROOT, triggering autotest to rerun. This can be confusing, but there is an easy way to figure this stuff out. Run autotest -v and it'll tell you what file changes it detected before rerunning... Then it is a matter of changing your code or adding a .autotest like so:

Autotest.add_hook :run do  |at|
  at.exceptions = /^(?:\.\/)?(?:db|doc|log|public|script|tmp|filestore|vendor\/r
ails)|\.svn|(?:.*_flymake\.rb$)/
end

Ugly... I know. I'll come up with a more flexible means of adding a single exclusion.

2 Comments

Love autotest! Sorry for snivelling, but I cannot for the life of my set up @exceptions to ignore flymake files in a standalone ruby project. I used

Autotest.addhook :initialize do |at| at.exceptions = /.*flymake.rb/ do

in my ~/.autotest as well as an add_hook :run version.

after restarting autotest -v still shows [["test/testbankingflymake.rb", timstamp stuff]]

I know that my ~/.autotest is being read since it is picking up my require 'autotest/kdenotify' clause.

any ideas??

Thanks Tom P.

Please ignore previous post.

The code in the released autotest gem seems to suggest that @exceptions can only hold a single regex to exclude directories. I had to override find_files to skip flymake files.

Can anyone confirm this?

Tom P.

Leave a comment