Michael Johnston
2006-Dec-21 10:54 UTC
[rspec-users] rspec_autotest no longer re-runs tests with rspec 0.7.5
Has anyone else encountered this problem? What I mean is, rspec_autotest runs all specs, then waits. When you change a spec, it reruns that spec. However, if that spec now passes, it should run the whole suite again, so you can see the next one to work on. It no longer does this. This renders it somewhat useless. Does anyone have autotest working with rspec 0.7.5, or does anyone have any idea of what may be causing this issue or how to go about fixing it? Cheers, Michael Johnston
aslak hellesoy
2006-Dec-21 17:16 UTC
[rspec-users] rspec_autotest no longer re-runs tests with rspec 0.7.5
rspec_autotest is not something we support in rspec. It''s not our code. Have you tried contacting the author? Aslak On 12/21/06, Michael Johnston <lastobelus at mac.com> wrote:> Has anyone else encountered this problem? > > What I mean is, rspec_autotest runs all specs, then waits. When you > change a spec, it reruns that spec. However, if that spec now passes, > it should run the whole suite again, so you can see the next one to > work on. It no longer does this. This renders it somewhat useless. > > Does anyone have autotest working with rspec 0.7.5, or does anyone > have any idea of what may be causing this issue or how to go about > fixing it? > > Cheers, > Michael Johnston > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Nick Sieger
2006-Dec-21 19:13 UTC
[rspec-users] rspec_autotest no longer re-runs tests with rspec 0.7.5
On 12/21/06, Michael Johnston <lastobelus at mac.com> wrote:> > Has anyone else encountered this problem? > > What I mean is, rspec_autotest runs all specs, then waits. When you > change a spec, it reruns that spec. However, if that spec now passes, > it should run the whole suite again, so you can see the next one to > work on. It no longer does this. This renders it somewhat useless. > > Does anyone have autotest working with rspec 0.7.5, or does anyone > have any idea of what may be causing this issue or how to go about > fixing it?Are you sure this is caused by the 0.7.5 upgrade? I''ve seen similar behavior but I''m still on 0.7.3. Here''s the response comment I posted to yours: I think this is expected behavior for autotest ? I''ve already noticed this and assumed it was standard behavior. The only time autotest reruns the whole suite is after I''ve just fixed a failing test or spec. Is it possible that''s what you''re observing? Feel free to take any further discussion off-list, thanks. /Nick -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20061221/3a0f1d68/attachment.html
Michael Johnston
2006-Dec-30 12:46 UTC
[rspec-users] rspec_autotest no longer re-runs tests with rspec 0.7.5
That is what I meant. In my setup, it is NOT rerunning the whole suite after I fix a failing spec. After a cursory look at autotest.rb in ZenTest, I haven''t figured out why it is broken. But I think I will try to figure that out today, because autotest seems kind of pointless without that behaviour. It probably has nothing to do with rspec or rspec_autotest; I realized that my version of ZenTest is new too, 3.4.3 instead of 3.4.1. Cheers, Michael On 21-Dec-06, at 11:13 AM, Nick Sieger wrote:> On 12/21/06, Michael Johnston <lastobelus at mac.com> wrote: > Has anyone else encountered this problem? > > What I mean is, rspec_autotest runs all specs, then waits. When you > change a spec, it reruns that spec. However, if that spec now passes, > it should run the whole suite again, so you can see the next one to > work on. It no longer does this. This renders it somewhat useless. > > Does anyone have autotest working with rspec 0.7.5, or does anyone > have any idea of what may be causing this issue or how to go about > fixing it? > > Are you sure this is caused by the 0.7.5 upgrade? I''ve seen > similar behavior but I''m still on 0.7.3. Here''s the response > comment I posted to yours: > > I think this is expected behavior for autotest ? I''ve already > noticed this and assumed it was standard behavior. The only time > autotest reruns the whole suite is after I''ve just fixed a failing > test or spec. Is it possible that''s what you''re observing? > > Feel free to take any further discussion off-list, thanks. > > /Nick > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20061230/5fe795da/attachment.html
Daniel Manges
2006-Dec-30 16:26 UTC
[rspec-users] rspec_autotest no longer re-runs tests with rspec 0.7.5
In my opinion the rspec_autotest plugin needs quite a bit of work. At a minimum it should be using the Inflector for pluralization. Example from current revision (r47): def tests_for_file(filename) case filename when %r%^spec/fixtures/(.*)s.yml% then ["spec/models/#{$1}_spec.rb", "spec/controllers/#{$1}_controller_spec.rb"] If I have a model City with fixtures cities.yml, rspec_autotest is going to try to run spec/models/citie_spec.rb and spec/controllers/citie_controller_spec.rb Nick, do you have plans on improving this? Thanks, Dan Manges On 12/30/06, Michael Johnston <lastobelus at mac.com> wrote:> > That is what I meant. In my setup, it is NOT rerunning the whole suite > after I fix a failing spec. > > After a cursory look at autotest.rb in ZenTest, I haven''t figured out why > it is broken. But I think I will try to figure that out today, because > autotest seems kind of pointless without that behaviour. > > It probably has nothing to do with rspec or rspec_autotest; I realized > that my version of ZenTest is new too, 3.4.3 instead of 3.4.1. > > Cheers, > Michael > On 21-Dec-06, at 11:13 AM, Nick Sieger wrote: > > On 12/21/06, Michael Johnston <lastobelus at mac.com> wrote: > > > > Has anyone else encountered this problem? > > > > What I mean is, rspec_autotest runs all specs, then waits. When you > > change a spec, it reruns that spec. However, if that spec now passes, > > it should run the whole suite again, so you can see the next one to > > work on. It no longer does this. This renders it somewhat useless. > > > > Does anyone have autotest working with rspec 0.7.5, or does anyone > > have any idea of what may be causing this issue or how to go about > > fixing it? > > > Are you sure this is caused by the 0.7.5 upgrade? I''ve seen similar > behavior but I''m still on 0.7.3. Here''s the response comment I posted to > yours: > > I think this is expected behavior for autotest ? I''ve already noticed this > and assumed it was standard behavior. The only time autotest reruns the > whole suite is after I''ve just fixed a failing test or spec. Is it possible > that''s what you''re observing? > > Feel free to take any further discussion off-list, thanks. > > /Nick > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20061230/665dd077/attachment.html
Nick Sieger
2006-Dec-30 22:13 UTC
[rspec-users] rspec_autotest no longer re-runs tests with rspec 0.7.5
On 12/30/06, Daniel Manges <daniel.manges at gmail.com> wrote:> > In my opinion the rspec_autotest plugin needs quite a bit of work. At a > minimum it should be using the Inflector for pluralization. > Example from current revision (r47): > > def tests_for_file(filename) > case filename > > when %r%^spec/fixtures/(.*)s.yml% then > ["spec/models/#{$1}_spec.rb", > "spec/controllers/#{$1}_controller_spec.rb"] > > If I have a model City with fixtures cities.yml, rspec_autotest is going > to try to run spec/models/citie_spec.rb and > spec/controllers/citie_controller_spec.rb > > Nick, do you have plans on improving this?Well, it certainly can be done. Any chance you can email me a patch against the latest rev at [1]? [1] http://svn.caldersphere.net/svn/main/rspec_autotest/trunk/lib/rspec_autotest.rb /Nick -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20061230/18463bfc/attachment.html
Michael Johnston
2007-Jan-02 02:46 UTC
[rspec-users] rspec_autotest no longer re-runs tests with rspec 0.7.5
Ok I just took the time to figure this out. It should have been obvious to me: turning on redgreen breaks the regex in "handle_results" which should create an array of failed tests because the color codes that are added to the result string. I discovered it was also mildly broken without color, because the second term in the regex needs to be made non greedy, or it matches everything after the first error. But because of the way this is used, I don''t think this would make much (any) difference to the functioning of autotest. Anyway, so here is the diff with the regex for handle_results function of rspec_autotest that works with redgreen turned on (and with spec command changed to use the rails_spec_server): Index: lib/rspec_autotest.rb ==================================================================--- lib/rspec_autotest.rb (revision 45) +++ lib/rspec_autotest.rb (working copy) @@ -26,7 +26,7 @@ attr_accessor :spec_command def initialize # :nodoc: - @spec_command = "spec --diff unified" + @spec_command = "script/rails_spec -C --diff unified" super @exceptions = %r%^\./(?:coverage|db|doc|log|public|script|vendor)% end @@ -76,7 +76,7 @@ end def handle_results(results) - failed = results.scan(/^\d+\)\n(?:.*?Error in )?''([^'']*?)''(?: FAILED)?\n(.*)\n\n/m) + failed = results.scan(/^\d+\)\n(?:\e\[\d*m)?(?:.*?Error in )?''([^'']*?)''(?: FAILED)?(?:\e\[\d*m)?\n(.*?)\n\n/m) @files_to_test = consolidate_failures failed unless @files_to_test.empty? then hook :red On 30-Dec-06, at 4:46 AM, Michael Johnston wrote:> That is what I meant. In my setup, it is NOT rerunning the whole > suite after I fix a failing spec. > > After a cursory look at autotest.rb in ZenTest, I haven''t figured > out why it is broken. But I think I will try to figure that out > today, because autotest seems kind of pointless without that > behaviour. > > It probably has nothing to do with rspec or rspec_autotest; I > realized that my version of ZenTest is new too, 3.4.3 instead of > 3.4.1. > > Cheers, > Michael > On 21-Dec-06, at 11:13 AM, Nick Sieger wrote: > >> On 12/21/06, Michael Johnston <lastobelus at mac.com> wrote: >> Has anyone else encountered this problem? >> >> What I mean is, rspec_autotest runs all specs, then waits. When you >> change a spec, it reruns that spec. However, if that spec now passes, >> it should run the whole suite again, so you can see the next one to >> work on. It no longer does this. This renders it somewhat useless. >> >> Does anyone have autotest working with rspec 0.7.5, or does anyone >> have any idea of what may be causing this issue or how to go about >> fixing it? >> >> Are you sure this is caused by the 0.7.5 upgrade? I''ve seen >> similar behavior but I''m still on 0.7.3. Here''s the response >> comment I posted to yours: >> >> I think this is expected behavior for autotest ? I''ve already >> noticed this and assumed it was standard behavior. The only time >> autotest reruns the whole suite is after I''ve just fixed a failing >> test or spec. Is it possible that''s what you''re observing? >> >> Feel free to take any further discussion off-list, thanks. >> >> /Nick >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070101/f0575b74/attachment.html
Nick Sieger
2007-Jan-02 16:03 UTC
[rspec-users] rspec_autotest no longer re-runs tests with rspec 0.7.5
On 1/1/07, Michael Johnston <lastobelus at mac.com> wrote:> > Ok I just took the time to figure this out. It should have been obvious to > me: turning on redgreen breaks the regex in "handle_results" which should > create an array of failed tests because the color codes that are added to > the result string. > I discovered it was also mildly broken without color, because the second > term in the regex needs to be made non greedy, or it matches everything > after the first error. But because of the way this is used, I don''t think > this would make much (any) difference to the functioning of autotest. > > Anyway, so here is the diff with the regex for handle_results function of > rspec_autotest that works with redgreen turned on (and with spec command > changed to use the rails_spec_server): > > Index: lib/rspec_autotest.rb > ==================================================================> --- lib/rspec_autotest.rb (revision 45) > +++ lib/rspec_autotest.rb (working copy) > @@ -26,7 +26,7 @@ > attr_accessor :spec_command > def initialize # :nodoc: > - @spec_command = "spec --diff unified" > + @spec_command = "script/rails_spec -C --diff unified" > super > @exceptions = %r%^\./(?:coverage|db|doc|log|public|script|vendor)% > end > @@ -76,7 +76,7 @@ > end > def handle_results(results) > - failed = results.scan(/^\d+\)\n(?:.*?Error in )?''([^'']*?)''(?: > FAILED)?\n(.*)\n\n/m) > + failed = results.scan(/^\d+\)\n(?:\e\[\d*m)?(?:.*?Error in > )?''([^'']*?)''(?: FAILED)?(?:\e\[\d*m)?\n(.*?)\n\n/m) > @files_to_test = consolidate_failures failed > unless @files_to_test.empty? then > hook :red >Thanks Michael, I committed a slightly modified version of the regex. I didn''t commit the change to @spec_command because you can easily customize this for yourself by putting a hook in your ~/.autotest: Autotest.add_hook :initialize do |at| if at.respond_to? :spec_command at.spec_command = "script/rails_spec -C --diff unified" end end Cheers, /Nick -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070102/1e08b634/attachment.html