ZenTest autotest problems

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/) without success

Thanks

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. - [email protected] - http://blog.segment7.net

I LIT YOUR GEM ON FIRE!

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

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. - [email protected] - http://blog.segment7.net

I LIT YOUR GEM ON FIRE!

On 12/19/06, Zouplaz [email protected] 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

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

On 12/19/06, Zouplaz [email protected] 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… :wink:

2006/12/19, Zouplaz [email protected]:

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 !

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