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
diff options
context:
space:
mode:
Diffstat (limited to 'spec/workers/database')
-rw-r--r--spec/workers/database/ci_namespace_mirrors_consistency_check_worker_spec.rb9
-rw-r--r--spec/workers/database/ci_project_mirrors_consistency_check_worker_spec.rb11
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