-
-
Notifications
You must be signed in to change notification settings - Fork 327
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
rake cucumber
fails on new rails 4 project with both rspec and cucumber
#253
Conversation
I figure it's equally likely to be a problem with rspec, so I've also reported the issue across at rspec/rspec-rails#792. |
I'm not sure why RSpec causing this kick in but it looks unrelated to me, except maybe it's changing the dependencies. |
See also cucumber/multi_test#2 |
Looks like the culprit is here: https://github.com/cucumber/cucumber-rails/blob/master/lib/cucumber/rails.rb#L11 |
cucumber/common#507 is related |
See also #256 |
version 1.4.0 is now rails compatible. |
I can confirm. I just upgraded to 1.4.0 with Rails 4.0 and have the same issue running |
This fix worked for me. Thanks, @stevenhaddox |
@stevenhaddox's fix worked for me too. Thanks! |
@Kosmas @aslakhellesoy I've added an explicit call to I'm not sure how to add a test for this? The only way I could recreate the error at all was by running cucumber in a new rails project, without using bundle exec. Is bundler load order deterministic? This should also fix #252. I had to change the version of cucumber required in the gemspec to get bundler to run locally - should this version of cucumber/rails require the latest version of cucumber? Would this change mean that we need an explicit dependency on multi_test in cucumber/rails? |
I can confirm that the |
@aslakhellesoy @Kosmas I think all of the rails apps generated by the cucumber-rails tests already include rspec, and they aren't failing? I've created a test repo at tooky/cucumber-rails-mini-test-at-exit-test If you checkout the first commit (tooky/cucumber-rails-mini-test-at-exit-test@a29e16c) and run
you should see the error caused by MiniTest at_exit firing. Then checkout the head commit (tooky/cucumber-rails-mini-test-at-exit-test@ e3354d07218034caf4a758392ff74a8d2a12e591) and run the same commands it should work ok. The second commit specifies this branch in the Gemfile. |
@aslakhellesoy @tooky Just created a new rails 4 app and installed cucumber. I'm just testing your fix @tooky and looks fine, so when the local tests pass I will merge the PR. @aslakhellesoy Should we do a test that when we add rspec-rails and run rake cucumber it should pass? |
`rake cucumber` fails on new rails 4 project with both rspec and cucumber
Sounds like it's hard to write a cucumber scenario that demonstrates the problem. No big deal - enough people have confirmed that this works. The only problem is catching regressions, but let's see how it goes. |
Thanks @tooky |
Just for information, until the new gem version is released to avoid the error you should replace: gem 'cucumber-rails', :require => false with: gem 'cucumber-rails', :require => false, git: 'https://github.com/cucumber/cucumber-rails.git' and run bundle install again. |
Just a thought, perhaps this change isn't needed to cucumber-rails after all? I think this line in cucumber, could move to after the support files are loaded. It would then disable autorun if any of the support files load minitest (or test/unit). That should allow cucumber-rails, not to care about how mini-test is disabled. I'm away camping so can't try it, but the thought just struck me. |
@tooky That sounds as a good option, but I do not think there is anything to do in cucumber-rails at the moment. |
It's definitely preferable to fix this in cucumber rather than cucumber-rails. That way, when another cucumber extension pops up, they don't have to replicate the fix. |
@mattwynne when this is changed in cucumber then we can change it here too.. So, @tooky @os97673 please let me know when it's done there, just in case I miss it. |
@mattwynne @Kosmas @os97673 I think this is a better fix for cucumber/cucumber-rails#253 so we can revert cucumber/cucumber-rails@974c933
Some files were missing, but most importantly, because of an incompatibility between cucumber and rails 4, I had to use the an unreleased version of cucumber that fixes that error. See cucumber/cucumber-rails#253
Have something same, error appeared after upgrade on Rails 4: http://stackoverflow.com/questions/21550514/cucumber-tests-suddenly-stops Tests just suddenly stop. We use cucumber, capybara, capybara-webkit. |
@Loremaster have you tried to use the master branch and see if you get the same error? |
I tried master branch of cucumber, and it didn't help. I think that problem was in capybara-webkit. I didn't have much time to collect enough information (because i couldn't even get any stack's trace, a lot of tests just failed silently, without any message), but migration to the poltergeist helped a lot. At least, number of failing tests decreased.
|
Just getting started on a new project – my first attempt with Rails 4 – and I've run into a minor snag. I've generated a demo project to show it off here: mathie/broken_cucumber_demo. Having installed and generated cucumber at mathie/broken_cucumber_demo@7474454, running
rake
orrake cucumber
works fine.However, after installing and generating rspec (in mathie/broken_cucumber_demo@c208712a149059c260bcdbe48ef204d0f42178e1), running
rake cucumber
results in:The backtrace suggests some autorun shenanigans, so I tried commenting out
require 'rspec/autorun'
from the spec helper, but that doesn't seem to have helped.Any thoughts?