[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ZenTest autotest problems

user@domain.invalid

12/16/2006 9:38:00 AM

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.or...) without success

Thanks
9 Answers

Eric Hodel

12/17/2006 6:44:00 AM

0

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 Hodel - drbrain@segment7.net - http://blog.se...

I LIT YOUR GEM ON FIRE!


user@domain.invalid

12/17/2006 8:50:00 AM

0

le 17/12/2006 07:43, Eric Hodel 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) ?

Eric Hodel

12/18/2006 5:50:00 AM

0

On Dec 17, 2006, at 24:55, Zouplaz wrote:
> le 17/12/2006 07:43, Eric Hodel 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 Hodel - drbrain@segment7.net - http://blog.se...

I LIT YOUR GEM ON FIRE!


user@domain.invalid

12/19/2006 1:02:00 PM

0

le 18/12/2006 06:50, Eric Hodel 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.

22) 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

Rob Sanheim

12/19/2006 2:14:00 PM

0

On 12/19/06, Zouplaz <user@domain.invalid> wrote:
> le 18/12/2006 06:50, Eric Hodel 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.
>
> 22) 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

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

--
http://www.robs...
http://www.seekin...
http://www.a...

user@domain.invalid

12/19/2006 3:20:00 PM

0

le 19/12/2006 15:13, Rob Sanheim 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

user@domain.invalid

12/20/2006 9:09:00 AM

0

le 19/12/2006 15:13, Rob Sanheim 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).
>

So, I've tested :
ruby ./vehicules_controller_test.rb
ruby -n ./vehicules_controller_test.rb -n test_destroy
rake test:functionals

They all pass the tests without any problem : 0 error, 0 failure.



autotest still fail...


Any idea again ?

Jano Svitok

12/20/2006 12:10:00 PM

0

On 12/19/06, Zouplaz <user@domain.invalid> wrote:
> 22) Failure:
> test_destroy(VehiculesControllerTest)
> [./test/functional/vehicules_controller_test.rb:39]:
> Expected response to be a <:success>, but was <302>

> ************************** 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

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... ;-)

David Goodlad

12/20/2006 4:53:00 PM

0

On 12/20/06, Zouplaz <user@domain.invalid> wrote:
> le 19/12/2006 15:13, Rob Sanheim 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).
> >
>
> So, I've tested :
> ruby ./vehicules_controller_test.rb
> ruby -n ./vehicules_controller_test.rb -n test_destroy
> rake test:functionals
>
> They all pass the tests without any problem : 0 error, 0 failure.
>
>
>
> autotest still fail...
>
>
> Any idea again ?

It really sounds to me like you've got a missing fixture in those
failing tests.
http://www.railtie.net/articles/2006/10/09/testing-gotcha...

You need to go through and make 100% sure that you explicitly load all
the appropriate fixtures for all of your test suites.

Dave

--
Dave Goodlad
dgoodlad@gmail.com or dave@goodlad.ca
http://david.g...