Skip to content
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

All tests break with 2.1.1 #149

Closed
DannyBen opened this issue Jan 19, 2016 · 3 comments
Closed

All tests break with 2.1.1 #149

DannyBen opened this issue Jan 19, 2016 · 3 comments

Comments

@DannyBen
Copy link

Hi,

I have the responders gem in my Gemfile.lock file since Devise requires it.

I noticed that after doing bundle update, and getting version 2.1.1 of responders, all hell breaks loose in my minitest tests. When I lock the responders gem to version 2.1.0, it goes back to normal.

Gemfile.lock - this breaks my tests

-    responders (2.1.0)
-      railties (>= 4.2.0, < 5)
+    responders (2.1.1)
+      railties (>= 4.2.0, < 5.1)

Output when running tests

/home/vagrant/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.5/lib/action_controller/base.rb:203: warning: already initialized constant ActionController::Base::MODULES
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.5/lib/action_controller/base.rb:203: warning: previous definition of MODULES was here
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.5/lib/action_controller/base.rb:254: warning: already initialized constant ActionController::Base::PROTECTED_IVARS
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.5/lib/action_controller/base.rb:254: warning: previous definition of PROTECTED_IVARS was here

Finished in 3.815882s, 24.8959 runs/s, 40.6197 assertions/s.

  1) Error:
PatientsControllerTest#test_should_get_edit:
ArgumentError: cyclic include detected
    app/controllers/application_controller.rb:1:in `<top (required)>'
    app/controllers/patients_controller.rb:2:in `<top (required)>'


  2) Error:
PatientsControllerTest#test_should_filter_patients_with_protocol:
NameError: undefined local variable or method `controller' for #<PatientsController:0x00000003805c98>
    test/controllers/patients_controller_test.rb:32:in `block in <class:PatientsControllerTest>'


  ... and many more like the second error above ...

System info:

Ubuntu 14.04.3 LTS
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
Rails 4.2.5
rvm 1.26.11 
Spring version 1.6.2
@lucasmazza
Copy link
Contributor

Can you post your entire Gemfile and/or the whole stack trace? #123 sounds like the culprit but my existing apps aren't triggering this issue.

@DannyBen
Copy link
Author

Yeah, I tried reproducing the problem on an empty app a couple of times in order to try and provide you with a better ticket, but it is quite time consuming and I failed so far.

I should probably also mention that the application itself seems to be working fine, its just the tests that fail. I tried commenting different things in my test helper, but was unable to pinpoint the problem.

As for the stack trace, there is no more lines in it - just more errors exactly the same as error 2 above, only at different places. If you believe it will help, I will generate again.

This is my cleaned Gemfile (comments removed) and all packages are up to date with bundle update (excluding dependencies that require specific version).

source 'https://rubygems.org'

gem 'rails', '4.2.5'
gem 'sass-rails'
gem 'uglifier'
gem 'coffee-rails'
gem 'jquery-rails'

# Note: this is my "fix" for the time being
gem 'responders', '<= 2.1.0'

gem 'runfile', :require => false
gem 'runfile-exec'
gem 'require_all'
gem 'filewatcher'

gem 'puma'
gem 'pg'

gem 'awesome_print' 
gem 'font-awesome-rails'
gem 'devise'
gem 'slim-rails'
gem 'multi_logger'
gem 'config'
gem 'kaminari'
gem 'crono'
gem 'premailer-rails'
gem 'newrelic_rpm'
gem 'twilio-ruby'
gem 'delayed_job_active_record'
gem 'daemons'
gem 'phony_rails'
gem 'i18n-timezones', github: 'DannyBen/i18n-timezones', branch: 'hebrew'
gem 'hashids'
gem 'rest-client'
gem 'chronic'
gem 'mailgun_rails'
gem 'rdiscount'

group :development, :test do
  gem 'dotenv-rails'
  gem 'byebug'
  gem 'artii', :require => false
  gem 'single_test' 
  gem 'minitest'
  gem 'mini_backtrace'
  gem 'cucumber-rails', :require => false
  gem 'database_cleaner'
  gem 'rspec-expectations'
  gem 'simplecov', "0.10",  :require => false
  gem 'quiet_assets'
  gem 'faker'
  gem 'colsole'
end

group :development do
  gem 'spring'
  gem "spring-commands-cucumber"
  gem 'better_errors', github: 'DannyBen/better_errors', branch: 'custom'
  gem 'binding_of_caller'
  gem 'query_diet'
  gem 'active_record_query_trace'
  gem 'request-log-analyzer', :require => false
  gem 'i18n_tools'  # command line tools
  gem 'i18n-debug'  # show debug info in server log
  gem 'bullet'
  gem 'railroady'
  gem 'rails-erd'
  gem 'reek', require: false
  gem 'brakeman', :require => false
  gem 'bundler-audit', :require => false
  gem 'rails_real_favicon'
end

group :production do
end

group :doc do
  gem 'sdoc' # , '~> 0.4.0'
end

ruby "2.2.1"

@DannyBen
Copy link
Author

I have since upgraded to Devise 4, and let is bring the latest responders (2.1.2) and the error is no longer happening. So unless someone else also complains about it, I guess this ticket can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants