Forum: RSpec Autospec Infinite Loop ??

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
918fec3ccefc8da359c12b0a8cf65f36?d=identicon&s=25 Arco (Guest)
on 2009-04-07 01:47
(Received via mailing list)
When I run autospec and I have a red example, autospec goes into an
infinite loop and runs over and over until I get rid of the red.

I hate this.  I want my tests to just run once when my ruby file is
saved - even if I have red examples.

The infinite loop does not happen if my examples are all green, all
yellow or a mix of green and yellow.

I have tried ZenTest 3.11, Zentest 4.0, and autotest (http://
github.com/grosser/autotest/tree/master).

Is there a way to make autospec run just once if it sees a red
example?

I am using rspec 1.2.2, platform: cygwin - testing a standalone ruby
class.

Thanks!!!
5d38ab152e1e3e219512a9859fcd93af?d=identicon&s=25 David Chelimsky (Guest)
on 2009-04-07 02:10
(Received via mailing list)
On Mon, Apr 6, 2009 at 4:50 PM, Arco <akleak@gmail.com> wrote:
> github.com/grosser/autotest/tree/master).
>
> Is there a way to make autospec run just once if it sees a red
> example?
>
> I am using rspec 1.2.2, platform: cygwin - testing a standalone ruby
> class.

What's in your spec/spec.opts file?
Ff4ea51c90e15b65b137e8fb60e60764?d=identicon&s=25 Alexandre Da Silva (lexrupy)
on 2009-06-10 05:27
David Chelimsky wrote:
> On Mon, Apr 6, 2009 at 4:50 PM, Arco <akleak@gmail.com> wrote:
>> github.com/grosser/autotest/tree/master).
>>
>> Is there a way to make autospec run just once if it sees a red
>> example?
>>
>> I am using rspec 1.2.2, platform: cygwin - testing a standalone ruby
>> class.
>
> What's in your spec/spec.opts file?

I get the same behavior....
my spec/spec.opts contains:
--colour
--format progress
--loadby mtime
--reverse


I can reproduce in a new project...

rails blog
cd blog/
script/generate rspec
script/generate rspec_scaffold posts title:string body:text
rm -rf test/
rake db:create:all
rake db:migrate
rake db:test:prepare
autospec

# posts generated in plural to get error at beginning

the loop runs forever
Ff4ea51c90e15b65b137e8fb60e60764?d=identicon&s=25 Alexandre Da Silva (lexrupy)
on 2009-06-10 05:28
sorry my self reply... but I forgot to mention that I am running Ubuntu
8.10 ruby 1.8.7.xx
Ff97ca87af59ee68ceff5877a8365788?d=identicon&s=25 Jarmo Pertman (juuser)
on 2009-06-12 09:07
(Received via mailing list)
Do you have any files, which might be changed during your failing
tests? Some temporary files or whatsoever? If that's the case, then
autotest thinks that you have made some changes already and tries to
run again. Solution would be to put that file into ignore list for
autotest.
Ff4ea51c90e15b65b137e8fb60e60764?d=identicon&s=25 Alexandre Da Silva (lexrupy)
on 2009-06-12 13:42
Jarmo Pertman wrote:
> Do you have any files, which might be changed during your failing
> tests? Some temporary files or whatsoever? If that's the case, then
> autotest thinks that you have made some changes already and tries to
> run again. Solution would be to put that file into ignore list for
> autotest.

No... all was working some days ago.
in fact the same issue occurs with a new fresh project. Here is my test

rails blogapp
cd blogapp
script/generate rspec
script/generate rspec_scaffold posts title:string body:text
rake db:migrate
autospec


This will cause error because posts is pluralized... so my autospec
loops forever.
all my applications are issuing the same behavior.

I am with latest rspec and rspec-rails gems (1.2.6 I mean)
when I back to my computer, I will provide a list of all my installed
gems.
3880f04333bf8375b44cd6aa135406c7?d=identicon&s=25 Bart Zonneveld (Guest)
on 2009-06-12 16:02
(Received via mailing list)
On 12 jun 2009, at 13:42, Alexandre Da Silva wrote:

> Jarmo Pertman wrote:
>> Do you have any files, which might be changed during your failing
>> tests? Some temporary files or whatsoever? If that's the case, then
>> autotest thinks that you have made some changes already and tries to
>> run again. Solution would be to put that file into ignore list for
>> autotest.
>
> No... all was working some days ago.

I have the same issue. Whether a red rspec or cucumber file, autotest
goes beserk.
Using the latest and greatest gems, on a fresh rails app.

gr,
bartz
Ff4ea51c90e15b65b137e8fb60e60764?d=identicon&s=25 Alexandre Da Silva (lexrupy)
on 2009-06-12 16:15
Bart Zonneveld wrote:
> On 12 jun 2009, at 13:42, Alexandre Da Silva wrote:
>
>> Jarmo Pertman wrote:
>>> Do you have any files, which might be changed during your failing
>>> tests? Some temporary files or whatsoever? If that's the case, then
>>> autotest thinks that you have made some changes already and tries to
>>> run again. Solution would be to put that file into ignore list for
>>> autotest.
>>
>> No... all was working some days ago.
>
> I have the same issue. Whether a red rspec or cucumber file, autotest
> goes beserk.
> Using the latest and greatest gems, on a fresh rails app.
>
> gr,
> bartz

it seems that many people are getting the same,
at least for me and all developers from my two teams.

yesterday I realise that when I have green results, then I modify my
controller files, than rspec does not auto restart the tests.
does anyone else having the same behavior?

att,
Alexandre
A91bd6cef23eb3516245a092e196c4da?d=identicon&s=25 Maurício Linhares (mauricio)
on 2009-06-12 16:23
(Received via mailing list)
5d38ab152e1e3e219512a9859fcd93af?d=identicon&s=25 David Chelimsky (Guest)
on 2009-06-12 16:30
(Received via mailing list)
On Fri, Jun 12, 2009 at 6:42 AM, Alexandre Da
Silva<lists@ruby-forum.com> wrote:
> rails blogapp
> cd blogapp
> script/generate rspec
> script/generate rspec_scaffold posts title:string body:text
> rake db:migrate
> autospec

I just copied this all into a shell and the specs ran only once and
stopped, as expected.

rspec-1.2.6
rspec-rails-1.2.6
ZenTest-4.1.1
Mac OS 10.5.7
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]

Anything different in your environment?

Also, I tried this with and without some autotest exceptions set up in
my ~/.autotest file, and it worked correctly in either case.
Ff4ea51c90e15b65b137e8fb60e60764?d=identicon&s=25 Alexandre Da Silva (lexrupy)
on 2009-06-13 23:19
David Chelimsky wrote:
> On Fri, Jun 12, 2009 at 6:42 AM, Alexandre Da
> Silva<lists@ruby-forum.com> wrote:
>> rails blogapp
>> cd blogapp
>> script/generate rspec
>> script/generate rspec_scaffold posts title:string body:text
>> rake db:migrate
>> autospec
>
> I just copied this all into a shell and the specs ran only once and
> stopped, as expected.
>
> rspec-1.2.6
> rspec-rails-1.2.6
> ZenTest-4.1.1
> Mac OS 10.5.7
> ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
>
> Anything different in your environment?
>
> Also, I tried this with and without some autotest exceptions set up in
> my ~/.autotest file, and it worked correctly in either case.

gems are the same... but I have a lot of other gems. I tested removing
all gems and reinstaling one by one... after all gems installed (except
remarkable gem) the test above ran as expected.

After some inspects I found in different projects two possible sources
of the problem.

Source one: remarkable gem
if you use remarkable, try do uninstall that gem and test if the testes
continue looping

Source two: localized_dates plugin
if you use this plugin try removing it and run the tests again. I mean
that localized_dates plugin is not needed in rails 2.3.3 anymore.
3880f04333bf8375b44cd6aa135406c7?d=identicon&s=25 Bart Zonneveld (Guest)
on 2009-06-15 14:29
(Received via mailing list)
On Jun 13, 2009, at 11:19 PM, Alexandre Da Silva wrote:

>> I just copied this all into a shell and the specs ran only once and
>> Also, I tried this with and without some autotest exceptions set up
>
> Source one: remarkable gem
> if you use remarkable, try do uninstall that gem and test if the
> testes
> continue looping
>
> Source two: localized_dates plugin
> if you use this plugin try removing it and run the tests again. I mean
> that localized_dates plugin is not needed in rails 2.3.3 anymore.

I don't have these plugins or gems, but I found out that downgrading
ZenTest to version 4.0.0 solved the problem.

HTH,
bartz
5d38ab152e1e3e219512a9859fcd93af?d=identicon&s=25 David Chelimsky (Guest)
on 2009-06-15 14:42
(Received via mailing list)
On Mon, Jun 15, 2009 at 7:18 AM, Bart Zonneveld<zuperinfinite@gmail.com>
wrote:
>>>> script/generate rspec
>>> Mac OS 10.5.7
>>
>
> I don't have these plugins or gems, but I found out that downgrading ZenTest
> to version 4.0.0 solved the problem.

Did you install the autotest-rails gem per the ZenTest 4.1 release
notes?
77237b97a465ae5a293ad323b7296837?d=identicon&s=25 Carlos A. da silva (carlosantoniodasilva)
on 2009-06-15 16:18
David Chelimsky wrote:
> On Mon, Jun 15, 2009 at 7:18 AM, Bart Zonneveld<zuperinfinite@gmail.com>
> wrote:
>>>>> script/generate rspec
>>>> Mac OS 10.5.7
>>>
>>
>> I don't have these plugins or gems, but I found out that downgrading ZenTest
>> to version 4.0.0 solved the problem.
>
> Did you install the autotest-rails gem per the ZenTest 4.1 release
> notes?

Same issue here..

Installed autotest-rails gem and everything is working fine now.

Thanks.

Carlos.
3880f04333bf8375b44cd6aa135406c7?d=identicon&s=25 Bart Zonneveld (Guest)
on 2009-06-15 16:21
(Received via mailing list)
On Jun 15, 2009, at 2:36 PM, David Chelimsky wrote:

>>>>> rails blogapp
>>>> rspec-rails-1.2.6
>>> gems are the same... but I have a lot of other gems. I tested
>>> if you use remarkable, try do uninstall that gem and test if the
>> to version 4.0.0 solved the problem.
>
> Did you install the autotest-rails gem per the ZenTest 4.1 release
> notes?

Of course not :).
I just ran sudo gem update :).
Will check, and report back though.

gr,
bartz
5d38ab152e1e3e219512a9859fcd93af?d=identicon&s=25 David Chelimsky (Guest)
on 2009-06-15 16:42
(Received via mailing list)
OK - top posting here so everyone on this thread will see this:

If you upgrade to ZenTest 4.1, you must install the autotest-rails gem
or you will get unexpected results.

http://blog.davidchelimsky.net/2009/06/08/upgradin...

Cheers,
David
This topic is locked and can not be replied to.