diff options
Diffstat (limited to 'spec/tasks/gitlab/db')
7 files changed, 7 insertions, 24 deletions
diff --git a/spec/tasks/gitlab/db/cells/bump_cell_sequences_rake_spec.rb b/spec/tasks/gitlab/db/cells/bump_cell_sequences_rake_spec.rb index a1725d6fed7..ff11e4ee8cb 100644 --- a/spec/tasks/gitlab/db/cells/bump_cell_sequences_rake_spec.rb +++ b/spec/tasks/gitlab/db/cells/bump_cell_sequences_rake_spec.rb @@ -1,14 +1,11 @@ # frozen_string_literal: true -require 'rake_helper' +require 'spec_helper' RSpec.describe 'gitlab:db:cells:bump_cell_sequences', :silence_stdout, :suppress_gitlab_schemas_validate_connection, feature_category: :cell, query_analyzers: false do before(:all) do Rake.application.rake_require 'tasks/gitlab/db/cells/bump_cell_sequences' - - # empty task as env is already loaded - Rake::Task.define_task :environment end let(:main_sequence_name) { 'users_id_seq' } diff --git a/spec/tasks/gitlab/db/decomposition/connection_status_rake_spec.rb b/spec/tasks/gitlab/db/decomposition/connection_status_rake_spec.rb index 352e3d944fc..2dba73886b8 100644 --- a/spec/tasks/gitlab/db/decomposition/connection_status_rake_spec.rb +++ b/spec/tasks/gitlab/db/decomposition/connection_status_rake_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'rake_helper' +require 'spec_helper' RSpec.describe 'gitlab:db:decomposition:connection_status', feature_category: :cell do let(:max_connections) { 500 } diff --git a/spec/tasks/gitlab/db/decomposition/rollback/bump_ci_sequences_rake_spec.rb b/spec/tasks/gitlab/db/decomposition/rollback/bump_ci_sequences_rake_spec.rb index 3d4b977644f..41c9e837ead 100644 --- a/spec/tasks/gitlab/db/decomposition/rollback/bump_ci_sequences_rake_spec.rb +++ b/spec/tasks/gitlab/db/decomposition/rollback/bump_ci_sequences_rake_spec.rb @@ -1,14 +1,11 @@ # frozen_string_literal: true -require 'rake_helper' +require 'spec_helper' RSpec.describe 'gitlab:db:decomposition:rollback:bump_ci_sequences', :silence_stdout, :suppress_gitlab_schemas_validate_connection, feature_category: :cell, query_analyzers: false do before(:all) do Rake.application.rake_require 'tasks/gitlab/db/decomposition/rollback/bump_ci_sequences' - - # empty task as env is already loaded - Rake::Task.define_task :environment end let(:expected_error_message) do diff --git a/spec/tasks/gitlab/db/lock_writes_rake_spec.rb b/spec/tasks/gitlab/db/lock_writes_rake_spec.rb index 5baf13b9847..4c5e3d437ae 100644 --- a/spec/tasks/gitlab/db/lock_writes_rake_spec.rb +++ b/spec/tasks/gitlab/db/lock_writes_rake_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'rake_helper' +require 'spec_helper' RSpec.describe 'gitlab:db:lock_writes', :reestablished_active_record_base, feature_category: :cell do before(:all) do @@ -8,9 +8,6 @@ RSpec.describe 'gitlab:db:lock_writes', :reestablished_active_record_base, featu Rake.application.rake_require 'tasks/seed_fu' Rake.application.rake_require 'tasks/gitlab/db/validate_config' Rake.application.rake_require 'tasks/gitlab/db/lock_writes' - - # empty task as env is already loaded - Rake::Task.define_task :environment end let(:table_locker) { instance_double(Gitlab::Database::TablesLocker) } diff --git a/spec/tasks/gitlab/db/migration_fix_15_11_rake_spec.rb b/spec/tasks/gitlab/db/migration_fix_15_11_rake_spec.rb index 9a101921b68..4ad149ef7d9 100644 --- a/spec/tasks/gitlab/db/migration_fix_15_11_rake_spec.rb +++ b/spec/tasks/gitlab/db/migration_fix_15_11_rake_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'rake_helper' +require 'spec_helper' RSpec.describe 'migration_fix_15_11', :reestablished_active_record_base, feature_category: :database do let(:db) { ApplicationRecord.connection } @@ -10,8 +10,6 @@ RSpec.describe 'migration_fix_15_11', :reestablished_active_record_base, feature before(:all) do Rake.application.rake_require 'active_record/railties/databases' Rake.application.rake_require 'tasks/gitlab/db/migration_fix_15_11' - - Rake::Task.define_task :environment end describe 'migration_fix_15_11' do diff --git a/spec/tasks/gitlab/db/truncate_legacy_tables_rake_spec.rb b/spec/tasks/gitlab/db/truncate_legacy_tables_rake_spec.rb index 518acfc5d81..940bb9baa60 100644 --- a/spec/tasks/gitlab/db/truncate_legacy_tables_rake_spec.rb +++ b/spec/tasks/gitlab/db/truncate_legacy_tables_rake_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'rake_helper' +require 'spec_helper' RSpec.describe 'gitlab:db:truncate_legacy_tables', :silence_stdout, :reestablished_active_record_base, :suppress_gitlab_schemas_validate_connection, feature_category: :cell do @@ -14,9 +14,6 @@ RSpec.describe 'gitlab:db:truncate_legacy_tables', :silence_stdout, :reestablish Rake.application.rake_require 'tasks/seed_fu' Rake.application.rake_require 'tasks/gitlab/db/validate_config' Rake.application.rake_require 'tasks/gitlab/db/truncate_legacy_tables' - - # empty task as env is already loaded - Rake::Task.define_task :environment end before do diff --git a/spec/tasks/gitlab/db/validate_config_rake_spec.rb b/spec/tasks/gitlab/db/validate_config_rake_spec.rb index e58667578b2..91d4190b815 100644 --- a/spec/tasks/gitlab/db/validate_config_rake_spec.rb +++ b/spec/tasks/gitlab/db/validate_config_rake_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'rake_helper' +require 'spec_helper' RSpec.describe 'gitlab:db:validate_config', :silence_stdout, :suppress_gitlab_schemas_validate_connection, feature_category: :cell do # We don't need to delete this data since it only modifies `ar_internal_metadata` @@ -11,9 +11,6 @@ RSpec.describe 'gitlab:db:validate_config', :silence_stdout, :suppress_gitlab_sc Rake.application.rake_require 'active_record/railties/databases' Rake.application.rake_require 'tasks/seed_fu' Rake.application.rake_require 'tasks/gitlab/db/validate_config' - - # empty task as env is already loaded - Rake::Task.define_task :environment end context "when validating config" do |