Skip to content
代码片段 群组 项目
提交 30a3bc29 编辑于 作者: Arturo Herrero's avatar Arturo Herrero
浏览文件

Fix Rubocop offense for elastic shared examples

EE: true
上级 85ba5dfd
No related branches found
No related tags found
2 合并请求!3031Merge per-main-jh to main-jh by luzhiyuan,!3030Merge per-main-jh to main-jh
......@@ -169,7 +169,6 @@ RSpec/ReceiveMessages:
- 'ee/spec/support/shared_contexts/requests/api/graphql/security_orchestration/policies_shared_contexts.rb'
- 'ee/spec/support/shared_contexts/secrets_check_shared_contexts.rb'
- 'ee/spec/support/shared_examples/controllers/namespace_storage_limit_alert_shared_examples.rb'
- 'ee/spec/support/shared_examples/elastic/migration_shared_examples.rb'
- 'ee/spec/support/shared_examples/graphql/mutations/work_items/update_status_widget_shared_examples.rb'
- 'ee/spec/support/shared_examples/graphql/mutations/work_items/update_weight_widget_shared_examples.rb'
- 'ee/spec/support/shared_examples/graphql/resolvers/security_orchestration/resolves_orchestration_policy_shared_examples.rb'
......
......@@ -71,8 +71,7 @@
end
it 'processes in batches', :aggregate_failures do
allow(migration).to receive(:batch_size).and_return(2)
allow(migration).to receive(:update_batch_size).and_return(1)
allow(migration).to receive_messages(batch_size: 2, update_batch_size: 1)
expect(::Elastic::ProcessInitialBookkeepingService).to receive(:track!).exactly(3).times.and_call_original
......@@ -272,8 +271,7 @@ def update_by_query(objects, script)
end
it 'processes in batches', :aggregate_failures do
allow(migration).to receive(:batch_size).and_return(2)
allow(migration).to receive(:update_batch_size).and_return(1)
allow(migration).to receive_messages(batch_size: 2, update_batch_size: 1)
expect(::Elastic::ProcessInitialBookkeepingService).to receive(:track!).exactly(3).times.and_call_original
......@@ -434,8 +432,7 @@ def assert_objects_have_new_schema_version(objects, schema_version = described_c
describe 'reindexing_cleanup!' do
context 'when the index already exists' do
before do
allow(helper).to receive(:index_exists?).and_return(true)
allow(helper).to receive(:create_standalone_indices).and_return(true)
allow(helper).to receive_messages(index_exists?: true, create_standalone_indices: true)
end
it 'deletes the index' do
......@@ -594,8 +591,7 @@ def assert_objects_have_new_schema_version(objects, schema_version = described_c
end
it 'processes in batches', :aggregate_failures do
allow(migration).to receive(:batch_size).and_return(1)
allow(migration).to receive(:limit_per_iteration).and_return(1)
allow(migration).to receive_messages(batch_size: 1, limit_per_iteration: 1)
expect(::Elastic::ProcessInitialBookkeepingService).to receive(:track!)
.exactly(objects.size).times.and_call_original
......@@ -646,8 +642,7 @@ def assert_objects_have_new_schema_version(objects, schema_version = described_c
before do
stub_ee_application_setting(elasticsearch_search: true, elasticsearch_indexing: true)
set_elasticsearch_migration_to(version, including: false)
allow(migration).to receive(:helper).and_return(helper)
allow(migration).to receive(:client).and_return(client)
allow(migration).to receive_messages(helper: helper, client: client)
# ensure objects are indexed
objects
......@@ -720,8 +715,7 @@ def assert_objects_have_new_schema_version(objects, schema_version = described_c
context 'when task in progress' do
before do
allow(migration).to receive(:completed?).and_return(false)
allow(migration).to receive(:client).and_return(client)
allow(migration).to receive_messages(completed?: false, client: client)
allow(helper).to receive(:task_status).and_return('completed' => false)
migration.set_migration_state(task_id: 'task_1')
end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册