diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-08 21:13:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-08 21:13:15 +0300 |
commit | 3a563d7c1e15023f205d2a357e5d8a38a3b53ecc (patch) | |
tree | b7979f23104af9ed6d0ef077ce9964ba5d7ad65e /spec/tasks | |
parent | dcc56fe601580b5d8f6c3da32550c6523f2baff3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/tasks')
-rw-r--r-- | spec/tasks/gitlab/db_rake_spec.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/tasks/gitlab/db_rake_spec.rb b/spec/tasks/gitlab/db_rake_spec.rb index c2cc6d05630..eb4024bbe6a 100644 --- a/spec/tasks/gitlab/db_rake_spec.rb +++ b/spec/tasks/gitlab/db_rake_spec.rb @@ -588,8 +588,14 @@ RSpec.describe 'gitlab:db namespace rake task', :silence_stdout, feature_categor describe 'drop_tables' do let(:tables) { %w(one two schema_migrations) } - let(:views) { %w(three four) } + let(:views) { %w(three four pg_stat_statements) } let(:schemas) { Gitlab::Database::EXTRA_SCHEMAS } + let(:ignored_views) { double(ActiveRecord::Relation, pluck: ['pg_stat_statements']) } + + before do + allow(Gitlab::Database::PgDepend).to receive(:using_connection).and_yield + allow(Gitlab::Database::PgDepend).to receive(:from_pg_extension).with('VIEW').and_return(ignored_views) + end context 'with a single database' do let(:connection) { ActiveRecord::Base.connection } @@ -664,6 +670,8 @@ RSpec.describe 'gitlab:db namespace rake task', :silence_stdout, feature_categor expect(connection).to receive(:execute).with('DROP VIEW IF EXISTS "three" CASCADE') expect(connection).to receive(:execute).with('DROP VIEW IF EXISTS "four" CASCADE') + expect(Gitlab::Database::PgDepend).to receive(:from_pg_extension).with('VIEW') + expect(connection).not_to receive(:execute).with('DROP VIEW IF EXISTS "pg_stat_statements" CASCADE') expect(connection).to receive(:execute).with('TRUNCATE schema_migrations') |