mperham / girl_friday

Have a task you want to get done but don't want to do it yourself? Give it to girl_friday!
http://mperham.github.com/girl_friday
MIT License
606 stars 26 forks source link

When included in a Rails app, test suites always return 0 exit status #67

Closed nateberkopec closed 11 years ago

nateberkopec commented 11 years ago

We use airbrake in our Rails 3.1 app for error handling, which uses girl_friday for asynchronous notifications. When using that feature of the airbrake gem, I realized our test suites always returned a 0 exit status regardless of pass or failure, and regardless of which test suite I used (minitest or RSpec). This broke our CI process.

https://github.com/mperham/girl_friday/blob/master/lib/girl_friday.rb#L96 is probably related. However, setting $testing to true in our spec_helper/test_helper does not resolve the bug.

I figured out pretty quickly that an at_exit callback was messing with our suites, but chasing it down with a binary search through our Gemfile wasn't very fun! Is there perhaps an easier way to identify whether or not girl_friday is being run in a testing environment?

mperham commented 11 years ago

I would propose removing the at_exit handler completely. It's been more trouble than it's worth.

nateberkopec commented 11 years ago

Tested 0.11.0 and Airbrake with girl_friday enabled, and it now works properly with an exit status of 1 instead of 0 when tests fail.

Thanks for the fast fix!