diff options
Diffstat (limited to 'spec/tasks')
-rw-r--r-- | spec/tasks/dev_rake_spec.rb | 4 | ||||
-rw-r--r-- | spec/tasks/gitlab/db_rake_spec.rb | 13 |
2 files changed, 9 insertions, 8 deletions
diff --git a/spec/tasks/dev_rake_spec.rb b/spec/tasks/dev_rake_spec.rb index 41728faa0e0..14a5ccfa323 100644 --- a/spec/tasks/dev_rake_spec.rb +++ b/spec/tasks/dev_rake_spec.rb @@ -23,7 +23,7 @@ RSpec.describe 'dev rake tasks' do subject(:setup_task) { run_rake_task('dev:setup') } - let(:connections) { Gitlab::Database.database_base_models.values.map(&:connection) } + let(:connections) { Gitlab::Database.database_base_models_with_gitlab_shared.values.map(&:connection) } it 'sets up the development environment', :aggregate_failures do expect(Rake::Task['gitlab:setup']).to receive(:invoke) @@ -55,7 +55,7 @@ RSpec.describe 'dev rake tasks' do end let(:connections) do - Gitlab::Database.database_base_models.values.filter_map do |model| + Gitlab::Database.database_base_models_with_gitlab_shared.values.filter_map do |model| model.connection if Gitlab::Database.db_config_share_with(model.connection_db_config).nil? end end diff --git a/spec/tasks/gitlab/db_rake_spec.rb b/spec/tasks/gitlab/db_rake_spec.rb index d8199c09ca1..74bec406947 100644 --- a/spec/tasks/gitlab/db_rake_spec.rb +++ b/spec/tasks/gitlab/db_rake_spec.rb @@ -45,7 +45,7 @@ RSpec.describe 'gitlab:db namespace rake task', :silence_stdout do before do skip_unless_ci_uses_database_tasks - allow(Gitlab::Database).to receive(:database_base_models).and_return(base_models) + allow(Gitlab::Database).to receive(:database_base_models_with_gitlab_shared).and_return(base_models) end it 'marks the migration complete on each database' do @@ -90,7 +90,7 @@ RSpec.describe 'gitlab:db namespace rake task', :silence_stdout do let(:base_models) { { 'main' => main_model } } before do - allow(Gitlab::Database).to receive(:database_base_models).and_return(base_models) + allow(Gitlab::Database).to receive(:database_base_models_with_gitlab_shared).and_return(base_models) end it 'prints a warning message' do @@ -110,7 +110,7 @@ RSpec.describe 'gitlab:db namespace rake task', :silence_stdout do let(:base_models) { { 'main' => main_model } } before do - allow(Gitlab::Database).to receive(:database_base_models).and_return(base_models) + allow(Gitlab::Database).to receive(:database_base_models_with_gitlab_shared).and_return(base_models) end it 'prints an error and exits' do @@ -136,6 +136,7 @@ RSpec.describe 'gitlab:db namespace rake task', :silence_stdout do context 'when geo is not configured' do before do allow(ActiveRecord::Base).to receive_message_chain('configurations.configs_for').and_return([main_config]) + allow(Gitlab::Database).to receive(:has_config?).with(:geo).and_return(false) end context 'when the schema is already loaded' do @@ -260,7 +261,7 @@ RSpec.describe 'gitlab:db namespace rake task', :silence_stdout do before do skip_unless_ci_uses_database_tasks - allow(Gitlab::Database).to receive(:database_base_models).and_return(base_models) + allow(Gitlab::Database).to receive(:database_base_models_with_gitlab_shared).and_return(base_models) end context 'when geo is not configured' do @@ -444,7 +445,7 @@ RSpec.describe 'gitlab:db namespace rake task', :silence_stdout do before do skip_unless_ci_uses_database_tasks - allow(Gitlab::Database).to receive(:database_base_models).and_return(base_models) + allow(Gitlab::Database).to receive(:database_base_models_with_gitlab_shared).and_return(base_models) allow(main_model.connection).to receive(:table_exists?).with('schema_migrations').and_return(true) allow(ci_model.connection).to receive(:table_exists?).with('schema_migrations').and_return(true) @@ -574,7 +575,7 @@ RSpec.describe 'gitlab:db namespace rake task', :silence_stdout do before do skip_if_multiple_databases_not_setup - allow(Gitlab::Database).to receive(:database_base_models).and_return(base_models) + allow(Gitlab::Database).to receive(:database_base_models_with_gitlab_shared).and_return(base_models) end it 'delegates to Gitlab::Database::Reindexing without a specific database' do |