-
Notifications
You must be signed in to change notification settings - Fork 554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rspec 2.14 + Ruby 2.1.0 + Simplecov 0.8.x doesn't pass along the correct exit status #281
Comments
it seems to happen only when combined with rspec javascript test (capybara+poltergeist). |
I've created test case. Perhaps a bit too big though. Travis report: https://travis-ci.org/edogawaconan/capytestruby21/builds/17829008 (pardon the repo name because initially I thought it's capybara bug) |
Is this a dupe of #269? |
in my case, ruby 2.0 isn't affected though. |
I dug a little deeper. https://travis-ci.org/BanzaiMan/travis_production_test/jobs/18281155 tests this code base, running on Ruby 2.1.0 and using this Gemfile.lock. As you can see, the combination of Ruby 2.1.0, RSpec 2.14.1 and SimpleCov 0.8.2, is not sufficient to show the problem here. I also added poltergeist for kicks (https://travis-ci.org/BanzaiMan/travis_production_test/jobs/18284015) but the problem does not manifest. Perhaps it is |
#269 (comment) implicates Rails 4. |
@BanzaiMan try enabling poltergeist by adding 'js: true' in the test case. |
@edogawaconan I don't know how to exercise JavaScript, I guess. At any rate, it seems to me that developers from poltergeist should be involved to track this down. |
when I checked last time, same error also occured when using capybara-webkit driver. |
@edogawaconan Could it be capybara, then? It's the common factor here, right? |
yeah, probably a combination of simplecov, capybara, and . |
So, I've finally also bumped into this at work. Mysteriously, it only manifests when I run the whole test suite, not for individual specs that fail (tried both with capybara acceptance spec and a model unit test). Digging in. |
Closed #269 in favor of this - I tried reverting the exit status changes from the 0.8 branch and also did a bit of binding.pry around the behaviour, I can not figure out what is going wrong, the behaviour is seemingly totally random :( This is happening with rspec 3 and rails 4 for me by the way. For now, I'm bailing and will downgrade to 0.7.1 myself... |
Same issue for us (Simplecov 0.8.x, Ruby 2.1.0, Rspec 2.14 and Rails 4.0.2), rolling back to 0.7.1 fixes it. |
Same issue here. Downgrading
|
* Added NDFD::DWML class to handle parsing of XML responses * Added Travis CI testing on 2.1.1 * Explicitly changed to simplecov 0.7.1 because of outstanding bug (see simplecov-ruby/simplecov#281) * Refreshed VCR cassettes * Removed GML api methods (the endpoints on the service don't work as expected) * Removed XSLT translation (it did not handle responses with multiple lat/longs) in favor of pure ruby parsing * Removed vendor folder (previous reference to noaa-dwml-to-json-xslt) * Updated documentation regarding GML methods
just saw a warning on circle-ci (which is pretty awesome) mentioning this issue. is there any known problem with this version and TestUnit? |
It's still unclear to me when exactly this is happening. I did try to debug the issue by comparing the code that changed in comparison to 0.7, but nothing obvious came up. It's possible this also happens with test unit if simplecov is the problem (which the downgrade fix suggests). |
Might be Rails 4 specific, "bundle exec rspec" returns exit code properly with the following;
|
Pin SimpleCov to version 0.7.1 to avoid the bug in SimpleCov 0.8.x affecting exit codes: simplecov-ruby/simplecov#281 Note that I had to change `profiles` to `adapters`, as the naming changed in version 0.8.0[1]. [1]: simplecov-ruby/simplecov@60f4717#diff-4ac32a78649ca5bdd8e0ba38b7006a1eR16
#302 is merged, though a test would really make sense here. I added a suggestion on that over at the other issue. Everyone else who was seeing this behaviour, could you please give the current master a shot against your repo via |
@colszowka with |
Do require: false instead of 'false' φ
|
@hajder @colszowka et al: sorry for not being helpful lately. It's been a busy week. http://www.commitstrip.com/en/2014/05/07/the-truth-behind-open-source-apps/ |
I have seen this issue on 0.8.*, but cannot replicate reliably. I am now running master branch as advised above, and have not seen this issue yet. |
Has anyone been able to reliably replicate this? I wonder if we should change our |
@bf4 maybe it's time to release this fix. I don't think it can be more broken than currently is (in 0.8 version) |
@hajder you mean master, right? only @colszowka has gem push |
yup. lot's of people waiting for this fix, I don't think my commit broke it more than it was ;) |
Hello Gentlemen, yes, this needs shipping. I just became a dad and hence am slightly busy, but I'll try to get it out over the weekend! |
@colszowka Congrats! Enjoy these moments. |
If this is fixed in master, can we close this issue? (And for those of you who have put more time into this than me, is there anything in #273 to consider merging?) |
#273 is pretty much the same fix. I think both can be closed. |
Confirmed fixed in master by
I've had trouble reproducing https://travis-ci.org/magiclabs/alchemy_cms/jobs/16516963#L403 2 Were there other reproducible failures we could/should test for fixes? While looking into this, I came across http://www.davekonopka.com/2013/rspec-exit-code.html by @davekonopka 2, 3 which also looked interesting, in general if defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby" && RUBY_VERSION >= "1.9"
module Kernel
alias :__at_exit :at_exit
def at_exit(&block)
__at_exit do
exit_status = $!.status if $!.is_a?(SystemExit)
block.call
exit exit_status if exit_status
end
end
end
end |
Bug in 0.8.x has finally been fixed! simplecov-ruby/simplecov#281
@bf4 so is this released as a gem in 0.8 branch? |
no, 0.9 is out. |
Due to issue given here: simplecov-ruby/simplecov#281
Looks like Simplecov 0.8.x, Ruby 2.1.0, and Rspec 2.14 don't quite work together as you would expect. When running
bundle exec rspec
in that environment (with Rails 4.0.2), the exit code when tests fail is0
, when it should be1
. However, when I run them on Ruby 2.0.0(-p353) with Simplecov 0.8.x, it correctly exits1
. Even weirder, when running them on Ruby 2.1.0 and Simplecov 0.7.1, it also correctly exits1
.The text was updated successfully, but these errors were encountered: