DEV: Check for pending migrations before running rspec suite

This should catch a few scenarios which can waste a lot of time in development
 - Forgetting to run migrations
 - Missing plugin migrations
 - Missing post_deploy migrations
This commit is contained in:
David Taylor 2019-12-13 12:50:18 +00:00
parent c068804a0a
commit f47909a2b6
1 changed files with 6 additions and 0 deletions

View File

@ -176,6 +176,12 @@ RSpec.configure do |config|
config.infer_base_class_for_anonymous_controllers = true
config.before(:suite) do
begin
ActiveRecord::Migration.check_pending!
rescue ActiveRecord::PendingMigrationError
raise "There are pending migrations, run RAILS_ENV=test bin/rake db:migrate"
end
Sidekiq.error_handlers.clear
# Ugly, but needed until we have a user creator