# 'rake test' abends with just Test failures - real error thro

**URL:** <https://www.ruby-forum.com/t/rake-test-abends-with-just-test-failures-real-error-thro/89173>\
**Category:** Rails\
**Created:** [March 18, 2007, 4:29am UTC](https://www.ruby-forum.com/t/rake-test-abends-with-just-test-failures-real-error-thro/89173 "2007-03-18T04:29:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phlip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Post date:** [March 18, 2007, 4:29am UTC](https://www.ruby-forum.com/t/rake-test-abends-with-just-test-failures-real-error-thro/89173/1 "2007-03-18T04:29:36Z")

</div>

Railsters:

The Rails test engine contains otherwise flawless error handling. So,  
after  
being bedeviled by intermittent “Test failure” abnormal test  
terminations, I  
finally got around to --trace-ing the problem, and when I found it the  
clumsiness surprised me:

desc ‘Test all units and functionals’  
task :test do  
Rake::Task[“test:units”].invoke rescue got\_error = true  
Rake::Task[“test:functionals”].invoke rescue got\_error = true

if File.exist?(“test/integration”)  
Rake::Task[“test:integration”].invoke rescue got\_error = true  
end

raise “Test failures” if got\_error  
end

What that means is, if any test\_ case fails, we see a healthy error  
message,  
but if the test rig itself fails, ‘rescue got\_error = true’ will throw  
away  
the e.message and e.backtrace, and the raise “Test failures” will  
provide an  
irrelevant error message and backtrace.

I’m going to copy this task :test into my lib/tasks/project.rake file,  
and  
replace the error hiding with a real error handling block. Further, if  
the  
test rig itself has failed, I don’t care to keep running any more tests,  
so  
I won’t bother with the system that tolerates their faults.

Why was this method so clumsy, and hasn’t anyone asked for an upgrade on  
it  
yet?

–  
Phlip  
[http://www.greencheese.us/ZeekLand](http://www.greencheese.us/ZeekLand) ← NOT a blog!!!

---

<div class="post-metadata">

**Author:** ![Phlip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Post date:** [March 18, 2007, 6:21am UTC](https://www.ruby-forum.com/t/rake-test-abends-with-just-test-failures-real-error-thro/89173/2 "2007-03-18T06:21:42Z")

</div>

this has been fixed in rails 1.2.3 -Tim

---

<div class="post-metadata">

**Author:** ![Phlip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Post date:** [March 18, 2007, 6:40am UTC](https://www.ruby-forum.com/t/rake-test-abends-with-just-test-failures-real-error-thro/89173/3 "2007-03-18T06:40:42Z")

</div>

dysinger wrote:

> this has been fixed in rails 1.2.3 -Tim

Thanks!

And to think that just this morning I ran ‘gem install -v=1.2.2  
rails --include-dependencies’, just to sync all my versions on all my  
computers… 😉

–  
Phlip  
[Redirecting...](http://www.greencheese.us/ZeekLand) ← NOT a blog!!!
