I've got a Rails 3.2.8 project with both legacy test/unit (minitest) tests and RSpecs. Although we have Jenkins running continuous integration, we haven't noticed failures in a while. The reason is that something seems to be overriding the exit code on a test failure and returning an exit code of 0 regardless whether there is a failing test, or spec.
I've done some digging, but would like to dig into the Kernel#at_exit stack to see what gems/plugins are registering a proc. I know it's a language feature that's implemented in C.
So, I'm looking for help shaving this yak:
Some things I've done:
at_exit but didn't find anything too suspicious.at_exitSome things I haven't done yet:
Thanks for your help in advance!
P.S.: Here are the gems in this project's Gemfile:
gem 'rails', '~> 3.2.8'
gem 'acts-as-taggable-on', '~> 2.3.1'
gem "akamai_api", :path => "vendor/git/akamai_api"
gem 'dalli'
gem "gabba"
gem "googlecharts", :require => "gchart"
gem "hpricot"
gem 'jquery-rails'
gem 'linkscape'
gem "logging", "1.4.3"
gem 'machinist', '>= 2.0.0.beta2'
gem "mysql2"
gem 'newrelic_rpm'
gem "premailer-rails3"
gem 'rack-cache'
gem "rack-ssl-enforcer"
gem 'sendgrid'
gem "tokyocabinet", "1.29"
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
gem "useragent"
gem "yajl-ruby", :require => "yajl"
group :assets do
gem 'coffee-rails'
gem 'sass-rails'
gem 'uglifier'
end
group :no_rake do
gem "vanity"
end
group :development, :test do
gem 'debugger'
gem 'thin'
gem 'rspec-rails'
end
group :test do
gem 'vanity'
gem 'minitest-rails'
gem 'mocha'
end
As an update, I did a binary tree search in the Gemfile (turn half off, run the tests, turn the other half off.. repeat) until I got the tests to fail properly. The logging gem was causing rspec to return nonzero, and the googlecharts gem was messing up test/unit. At this point, I don't know why.
I haven't dug in further to see which behavior(s) of the libraries (or the dependent code in my app) are affecting the tests. A quick grep didn't return anything using Kernel#at_exit and a quick glance of the source on each of those didn't turn up anything either. I'll keep digging, but that's what I found out so far.
I haven't filed bug reports, as I don't yet know what the problem is.
You gotta love ruby :)
alias original_at_exit at_exit
def at_exit(*args, &block)
puts "registered at exit: #{caller * "\n"}"
original_at_exit *args, &block
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With