# ZenTest autotest problems

**URL:** <https://www.ruby-forum.com/t/zentest-autotest-problems/79553>\
**Category:** Ruby\
**Created:** [December 16, 2006, 10:41am UTC](https://www.ruby-forum.com/t/zentest-autotest-problems/79553 "2006-12-16T10:41:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zouplaz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/a4c791/32.png) [@Zouplaz](https://www.ruby-forum.com/u/Zouplaz)\
**Post date:** [December 16, 2006, 10:41am UTC](https://www.ruby-forum.com/t/zentest-autotest-problems/79553/1 "2006-12-16T10:41:27Z")

</div>

Hello, I have big troubles using the latest autotest version (3.4.2)

My current project passes all the tests under the 3.3.0 version but I  
get dozens of assertion errors with the 3.4.2

What’s wrong ?

Is there something special to do on the project configuration or test  
scripts (I hope no) except executing autotest ?

I’ve tried to find some info in the doc  
([http://zentest.rubyforge.org/ZenTest/](http://zentest.rubyforge.org/ZenTest/)) without success

Thanks

---

<div class="post-metadata">

**Author:** ![Zouplaz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/a4c791/32.png) [@Zouplaz](https://www.ruby-forum.com/u/Zouplaz)\
**Post date:** [December 17, 2006, 7:43am UTC](https://www.ruby-forum.com/t/zentest-autotest-problems/79553/2 "2006-12-17T07:43:53Z")

</div>

On Dec 16, 2006, at 01:40, Zouplaz wrote:

> Hello, I have big troubles using the latest autotest version (3.4.2)
> 
> My current project passes all the tests under the 3.3.0 version but  
> I get dozens of assertion errors with the 3.4.2
> 
> What’s wrong ?

Using my intensely powerful mind-reading psychic skills, I’ll have to  
say that you forgot to sacrifice a goat.

Sacrifice a goat and that should fix it. In fact, two wouldn’t hurt.

> Is there something special to do on the project configuration or  
> test scripts (I hope no) except executing autotest ?

Hrm, on second thought you could post some information about what  
failures you’re getting with autotest 3.4.2 vs 3.3.0. Or perhaps  
even file a bug with all this information.

–  
Eric H. - removed\_email\_address@domain.invalid - [http://blog.segment7.net](http://blog.segment7.net)

I LIT YOUR GEM ON FIRE!

---

<div class="post-metadata">

**Author:** ![Zouplaz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/a4c791/32.png) [@Zouplaz](https://www.ruby-forum.com/u/Zouplaz)\
**Post date:** [December 17, 2006, 9:55am UTC](https://www.ruby-forum.com/t/zentest-autotest-problems/79553/3 "2006-12-17T09:55:57Z")

</div>

le 17/12/2006 07:43, Eric H. nous a dit:

> Using my intensely powerful mind-reading psychic skills, I’ll have to  
> say that you forgot to sacrifice a goat.
> 
> Sacrifice a goat and that should fix it. In fact, two wouldn’t hurt.

I did it (almost, in fact it was a cow) but it the tests still don’t  
pass…

> > Is there something special to do on the project configuration or test  
> > scripts (I hope no) except executing autotest ?
> 
> Hrm, on second thought you could post some information about what  
> failures you’re getting with autotest 3.4.2 vs 3.3.0. Or perhaps even  
> file a bug with all this information.

There is nothing special in the test files : they pass successfully  
rake:units and rake:functionals which I presume can be seen as a good  
sign coming from the gods.

So, if there is a sorcerer around please tell me the main differences or  
bugs introduced in the versions above 3.3.0 ? Do I have to modify the  
test helper ? The test files ? (which would be a bad idea) ?

---

<div class="post-metadata">

**Author:** ![Zouplaz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/a4c791/32.png) [@Zouplaz](https://www.ruby-forum.com/u/Zouplaz)\
**Post date:** [December 18, 2006, 6:52am UTC](https://www.ruby-forum.com/t/zentest-autotest-problems/79553/4 "2006-12-18T06:52:18Z")

</div>

On Dec 17, 2006, at 24:55, Zouplaz wrote:

> le 17/12/2006 07:43, Eric H. nous a dit:
> 
> > > Is there something special to do on the project configuration or  
> > > test scripts (I hope no) except executing autotest ?  
> > > Hrm, on second thought you could post some information about what  
> > > failures you’re getting with autotest 3.4.2 vs 3.3.0. Or perhaps  
> > > even file a bug with all this information.
> 
> There is nothing special in the test files : they pass successfully  
> rake:units and rake:functionals which I presume can be seen as a  
> good sign coming from the gods.

Can you include a failure?

> So, if there is a sorcerer around please tell me the main  
> differences or bugs introduced in the versions above 3.3.0 ? Do I  
> have to modify the test helper ? The test files ? (which would be a  
> bad idea) ?

There shouldn’t be any changes needed between 3.3 and 3.4.

–  
Eric H. - removed\_email\_address@domain.invalid - [http://blog.segment7.net](http://blog.segment7.net)

I LIT YOUR GEM ON FIRE!

---

<div class="post-metadata">

**Author:** ![Zouplaz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/a4c791/32.png) [@Zouplaz](https://www.ruby-forum.com/u/Zouplaz)\
**Post date:** [December 20, 2006, 7:14pm UTC](https://www.ruby-forum.com/t/zentest-autotest-problems/79553/5 "2006-12-20T19:14:23Z")

</div>

On 12/19/06, Zouplaz [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> test\_destroy(VehiculesControllerTest)  
> post :destroy, :id =\> @johnfoo.vehicules[0].id  
> render :partial =\> ‘liste’  
> “test/functional/alerts\_controller\_test.rb”
> 
> 44 tests, 185 assertions, 0 failures, 0 errors

A few things to try before you assume its autotest:

1. run the single failing test method in question by itself
2. run the functional test case in question by itself
3. run the functional test suite by itself

These steps will often turn up issues where fixtures aren’t specified  
where they should be, or where test order is playing a part (where it  
shouldn’t be).

- Rob

---

<div class="post-metadata">

**Author:** ![Zouplaz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/a4c791/32.png) [@Zouplaz](https://www.ruby-forum.com/u/Zouplaz)\
**Post date:** [December 20, 2006, 6:35pm UTC](https://www.ruby-forum.com/t/zentest-autotest-problems/79553/6 "2006-12-20T18:35:50Z")

</div>

le 18/12/2006 06:50, Eric H. nous a dit:

> Can you include a failure?

Yes, the one below - Is there something wrong ? I really don’t see the  
cause. Just for info, the test\_helper.rb is unmodified.

1. Failure:  
test\_destroy(VehiculesControllerTest)  
[./test/functional/vehicules\_controller\_test.rb:39]:  
Expected response to be a \<:success\>, but was \<302\>

The overall autotest gives : 81 tests, 309 assertions, 13 failures, 12  
errors

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* vehicules\_controller\_test.rb

def test\_destroy  
s = @johnfoo.vehicules.size  
post :destroy, :id =\> @johnfoo.vehicules[0].id  
assert\_response :success  
@johnfoo.reload  
assert\_equal s-1, @johnfoo.vehicules.size  
end

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* vehicules\_controller.rb

def destroy  
@client = Vehicule.find(params[:id]).client  
Vehicule.destroy(params[:id])  
render :partial =\> ‘liste’  
end

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* rake:functionals

(in /usr/local/www/ror\_mica)  
/usr/bin/ruby -Ilib:test  
“/usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake\_test\_loader.rb”  
“test/functional/clients\_controller\_test.rb”  
“test/functional/telephones\_controller\_test.rb”  
“test/functional/vehicules\_controller\_test.rb”  
“test/functional/alerts\_controller\_test.rb”  
“test/functional/forfaits\_controller\_test.rb”  
“test/functional/mouvements\_controller\_test.rb”  
“test/functional/statistiques\_controller\_test.rb”  
“test/functional/factures\_controller\_test.rb”  
Loaded suite  
/usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake\_test\_loader  
Started  
…  
.  
Finished in 8.999147 seconds.

44 tests, 185 assertions, 0 failures, 0 errors

---

<div class="post-metadata">

**Author:** ![Zouplaz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/a4c791/32.png) [@Zouplaz](https://www.ruby-forum.com/u/Zouplaz)\
**Post date:** [December 20, 2006, 7:24pm UTC](https://www.ruby-forum.com/t/zentest-autotest-problems/79553/7 "2006-12-20T19:24:55Z")

</div>

On 12/19/06, Zouplaz [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 1. Failure:  
> test\_destroy(VehiculesControllerTest)  
> [./test/functional/vehicules\_controller\_test.rb:39]:  
> Expected response to be a \<:success\>, but was \<302\>

> \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* vehicules\_controller.rb
> 
> def destroy  
> @client = Vehicule.find(params[:id]).client  
> Vehicule.destroy(params[:id])  
> render :partial =\> ‘liste’  
> end

HTTP 302 means Moved temporarily. have a look at your logs to what url  
are the tests posting (with or without autotest). Or how the autotest  
might interfere with it. Or why :success doesn’t include 302.

…not that I know anything about autotest nor rails testing… 😉

---

<div class="post-metadata">

**Author:** ![Zouplaz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/a4c791/32.png) [@Zouplaz](https://www.ruby-forum.com/u/Zouplaz)\
**Post date:** [December 20, 2006, 8:27pm UTC](https://www.ruby-forum.com/t/zentest-autotest-problems/79553/8 "2006-12-20T20:27:33Z")

</div>

2006/12/19, Zouplaz [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> test case or a test suite ?

# Run one test method

ruby test/functional/some\_controller\_test.rb -n  
test\_this\_specific\_method

# Run one test case

ruby test/functional/some\_controller\_test.rb

# Run functionals only

rake test:functionals

There’s also:  
rake test:functionals TEST=test/functional/some\_controller\_test.rb

I prefer to call the rb file directly though.

Hope that helps !

---

<div class="post-metadata">

**Author:** ![Zouplaz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/a4c791/32.png) [@Zouplaz](https://www.ruby-forum.com/u/Zouplaz)\
**Post date:** [December 20, 2006, 7:53pm UTC](https://www.ruby-forum.com/t/zentest-autotest-problems/79553/9 "2006-12-20T19:53:16Z")

</div>

le 19/12/2006 15:13, Rob S. nous a dit:

> A few things to try before you assume its autotest:
> 
> 1. run the single failing test method in question by itself
> 2. run the functional test case in question by itself
> 3. run the functional test suite by itself
> 
> These steps will often turn up issues where fixtures aren’t specified  
> where they should be, or where test order is playing a part (where it  
> shouldn’t be).

Good idea, but what is the rake command to only run a test method, a  
test case or a test suite ?

Thanks
