mirror of
https://github.com/discourse/discourse.git
synced 2025-04-28 11:44:35 +08:00
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:
parent
c068804a0a
commit
f47909a2b6
@ -176,6 +176,12 @@ RSpec.configure do |config|
|
|||||||
config.infer_base_class_for_anonymous_controllers = true
|
config.infer_base_class_for_anonymous_controllers = true
|
||||||
|
|
||||||
config.before(:suite) do
|
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
|
Sidekiq.error_handlers.clear
|
||||||
|
|
||||||
# Ugly, but needed until we have a user creator
|
# Ugly, but needed until we have a user creator
|
||||||
|
Loading…
x
Reference in New Issue
Block a user