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
fix factoryGirl screws up rake db:migrate process #2955
Conversation
I've prepared a stage to preview changes. Open stage or view logs. |
@marutosi you need to add require statements to |
☝️ what @myabc said. Otherwise the test suite(s) won't run properly. |
$ rake db:migrate RAILS_ENV=test rake aborted! ActiveRecord::StatementInvalid: Could not find table 'work_package_journals' http://stackoverflow.com/questions/12423273/factorygirl-screws-up-rake-dbmigrate-process
Sadly after merging this PR specs for plugins are broken... See discussion here: 30dcd66 |
I will for now revert this PR, because running specs is kind of important to me. If anybody has feedback on:
they should call me. Best regards |
reverting this PR is not really an option as this breaks migrations locally (I believe @machisuji also hit this issue a couple times) |
@myabc I think your sentence was not complete. The problem here is that we are in a workable state without this PR and in a completely not workable state with this PR. My third question could be when do I ever need to run |
I can confirm that I do run into this problem locally every time I try to set up a config. Migrations fail. Specs don't run. Doing the 'require: false' trick does help. Dunno why it breaks the specs on the CI. I think this is a good opportunity to take a thorough look at the problem and fix it once and for all. Any volunteers? |
Just for the record: It does not break the specs on the CI. It breaks the specs for plugins! Locally as well as on the CI. @machisuji Does I am fine with someone solving the issue once and for all, but it needs to work ^^ |
I find myself needing this surprisingly often. For instance, when if I modify the database schema and want to run a single spec. |
I guess I did not run into that issue because of my |
@NobodysNightmare can you try moving the require 'factory_girl_rails'
require File.expand_path('../../config/environment', __FILE__) Then This works for me, but not yet 100% sure why. |
FactoryGirl does some magic to find definitions (see |
I ought to have read the part of the docs on using Factory Girl without Bundler. |
$ rake db:migrate RAILS_ENV=test
rake aborted!
ActiveRecord::StatementInvalid: Could not find table 'work_package_journals'
http://stackoverflow.com/questions/12423273/factorygirl-screws-up-rake-dbmigrate-process