diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-06 12:07:38 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-06 12:07:38 +0300 |
commit | 3c21cbd6a81d7b962a5d9a72ba8e03f3bf449af8 (patch) | |
tree | 5e7b2c89325173357783b1189e7c16b5369593ed /spec/workers/database | |
parent | a5185ab98611ded25864ffdf3e358e4a139f4928 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers/database')
-rw-r--r-- | spec/workers/database/ci_namespace_mirrors_consistency_check_worker_spec.rb | 9 | ||||
-rw-r--r-- | spec/workers/database/ci_project_mirrors_consistency_check_worker_spec.rb | 11 |
2 files changed, 19 insertions, 1 deletions
diff --git a/spec/workers/database/ci_namespace_mirrors_consistency_check_worker_spec.rb b/spec/workers/database/ci_namespace_mirrors_consistency_check_worker_spec.rb index 116026ea8f7..e5024c568cb 100644 --- a/spec/workers/database/ci_namespace_mirrors_consistency_check_worker_spec.rb +++ b/spec/workers/database/ci_namespace_mirrors_consistency_check_worker_spec.rb @@ -62,6 +62,15 @@ RSpec.describe Database::CiNamespaceMirrorsConsistencyCheckWorker do expect(worker).to receive(:log_extra_metadata_on_done).with(:results, expected_result) worker.perform end + + it 'calls the consistency_fix_service to fix the inconsistencies' do + allow_next_instance_of(Database::ConsistencyFixService) do |instance| + expect(instance).to receive(:execute).with( + ids: [missing_namespace.id] + ).and_call_original + end + worker.perform + end end end end diff --git a/spec/workers/database/ci_project_mirrors_consistency_check_worker_spec.rb b/spec/workers/database/ci_project_mirrors_consistency_check_worker_spec.rb index b6bd825ffcd..f8e950d8917 100644 --- a/spec/workers/database/ci_project_mirrors_consistency_check_worker_spec.rb +++ b/spec/workers/database/ci_project_mirrors_consistency_check_worker_spec.rb @@ -38,7 +38,7 @@ RSpec.describe Database::CiProjectMirrorsConsistencyCheckWorker do before do redis_shared_state_cleanup! stub_feature_flags(ci_project_mirrors_consistency_check: true) - create_list(:project, 10) # This will also create Ci::NameSpaceMirror objects + create_list(:project, 10) # This will also create Ci::ProjectMirror objects missing_project.delete allow_next_instance_of(Database::ConsistencyCheckService) do |instance| @@ -62,6 +62,15 @@ RSpec.describe Database::CiProjectMirrorsConsistencyCheckWorker do expect(worker).to receive(:log_extra_metadata_on_done).with(:results, expected_result) worker.perform end + + it 'calls the consistency_fix_service to fix the inconsistencies' do + expect_next_instance_of(Database::ConsistencyFixService) do |instance| + expect(instance).to receive(:execute).with( + ids: [missing_project.id] + ).and_call_original + end + worker.perform + end end end end |