Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2024-01-21 18:08:07 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2024-01-21 18:08:07 +0300
commit61d7d07541aafcf49a97159a6048cf6847adbd51 (patch)
treebe1a381102a73d97ec3cd071d138cc4338623d83 /spec
parent0d932b7e02b1d3618bf71012e20a33d7f2d282a6 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/migrations/20240116211138_update_max_code_indexing_concurrency_in_application_settings_for_gitlab_com_spec.rb48
1 files changed, 48 insertions, 0 deletions
diff --git a/spec/migrations/20240116211138_update_max_code_indexing_concurrency_in_application_settings_for_gitlab_com_spec.rb b/spec/migrations/20240116211138_update_max_code_indexing_concurrency_in_application_settings_for_gitlab_com_spec.rb
new file mode 100644
index 00000000000..8bed7e1b8a1
--- /dev/null
+++ b/spec/migrations/20240116211138_update_max_code_indexing_concurrency_in_application_settings_for_gitlab_com_spec.rb
@@ -0,0 +1,48 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+require_migration!
+
+RSpec.describe UpdateMaxCodeIndexingConcurrencyInApplicationSettingsForGitlabCom, feature_category: :global_search do
+ let(:settings) { table(:application_settings) }
+
+ describe "#up" do
+ subject(:up) { migrate! }
+
+ it 'does nothing when not in gitlab.com' do
+ record = settings.create!
+
+ expect { up }.not_to change { record.reload.elasticsearch_max_code_indexing_concurrency }
+ end
+
+ it 'updates elasticsearch_worker_number_of_shards when gitlab.com' do
+ allow(Gitlab).to receive(:com?).and_return(true)
+
+ record = settings.create!
+
+ expect { up }.to change { record.reload.elasticsearch_max_code_indexing_concurrency }.from(30).to(60)
+ end
+ end
+
+ describe "#down" do
+ subject(:down) { schema_migrate_down! }
+
+ it 'does nothing when not in gitlab.com' do
+ record = settings.create!(elasticsearch_max_code_indexing_concurrency: 60)
+
+ migrate!
+
+ expect { down }.not_to change { record.reload.elasticsearch_max_code_indexing_concurrency }
+ end
+
+ it 'updates elasticsearch_worker_number_of_shards when gitlab.com' do
+ allow(Gitlab).to receive(:com?).and_return(true)
+
+ record = settings.create!(elasticsearch_max_code_indexing_concurrency: 60)
+
+ migrate!
+
+ expect { down }.to change { record.reload.elasticsearch_max_code_indexing_concurrency }.from(60).to(30)
+ end
+ end
+end