Phlip
2007-Mar-18 03:28 UTC
''rake test'' abends with just Test failures - real error thrown away
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 <-- NOT a blog!!! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
dysinger
2007-Mar-18 05:20 UTC
Re: ''rake test'' abends with just Test failures - real error thrown away
this has been fixed in rails 1.2.3 -Tim On Mar 17, 5:28 pm, "Phlip" <phlip2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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<-- NOT a blog!!!--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Phlip
2007-Mar-18 05:39 UTC
Re: ''rake test'' abends with just Test failures - real error thrown away
dysinger wrote:> this has been fixed in rails 1.2.3 -TimThanks! 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 http://www.greencheese.us/ZeekLand <-- NOT a blog!!! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---