From cdda3d117c99cadf295f26abc92cb2456033b762 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 8 Jun 2022 12:08:46 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/tasks/gitlab/db/validate_config_rake_spec.rb | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'spec/tasks') diff --git a/spec/tasks/gitlab/db/validate_config_rake_spec.rb b/spec/tasks/gitlab/db/validate_config_rake_spec.rb index 0b2c844a91f..b4bad3dd7b9 100644 --- a/spec/tasks/gitlab/db/validate_config_rake_spec.rb +++ b/spec/tasks/gitlab/db/validate_config_rake_spec.rb @@ -3,6 +3,10 @@ require 'rake_helper' RSpec.describe 'gitlab:db:validate_config', :silence_stdout do + # We don't need to delete this data since it only modifies `ar_internal_metadata` + # which would not be cleaned either by `DbCleaner` + self.use_transactional_tests = false + before :all do Rake.application.rake_require 'active_record/railties/databases' Rake.application.rake_require 'tasks/seed_fu' @@ -111,6 +115,26 @@ RSpec.describe 'gitlab:db:validate_config', :silence_stdout do end it_behaves_like 'validates successfully' + + context 'when config is pointing to incorrect server' do + let(:test_config) do + { + main: main_database_config.merge(port: 11235) + } + end + + it_behaves_like 'validates successfully' + end + + context 'when config is pointing to non-existent database' do + let(:test_config) do + { + main: main_database_config.merge(database: 'non_existent_database') + } + end + + it_behaves_like 'validates successfully' + end end context 'when main: uses database_tasks=false' do -- cgit v1.2.3