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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-03 21:08:54 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-03 21:08:54 +0300
commit27484d14658e92177e059ef905e9562c71ad9a3f (patch)
tree085e2a2720796fab97079e964ddf18ce391ad5f1 /spec/workers/database
parentf5f6cb45c73c8aa059c3006a3696014522a41a4b (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.rb29
-rw-r--r--spec/workers/database/ci_project_mirrors_consistency_check_worker_spec.rb29
2 files changed, 10 insertions, 48 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 e5024c568cb..1c083d1d8a3 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
@@ -6,29 +6,11 @@ RSpec.describe Database::CiNamespaceMirrorsConsistencyCheckWorker do
let(:worker) { described_class.new }
describe '#perform' do
- context 'feature flag is disabled' do
- before do
- stub_feature_flags(ci_namespace_mirrors_consistency_check: false)
- end
-
- it 'does not perform the consistency check on namespaces' do
- expect(Database::ConsistencyCheckService).not_to receive(:new)
- expect(worker).not_to receive(:log_extra_metadata_on_done)
- worker.perform
- end
- end
-
- context 'feature flag is enabled' do
- before do
- stub_feature_flags(ci_namespace_mirrors_consistency_check: true)
- end
-
- it 'executes the consistency check on namespaces' do
- expect(Database::ConsistencyCheckService).to receive(:new).and_call_original
- expected_result = { batches: 0, matches: 0, mismatches: 0, mismatches_details: [] }
- expect(worker).to receive(:log_extra_metadata_on_done).with(:results, expected_result)
- worker.perform
- end
+ it 'executes the consistency check on namespaces' do
+ expect(Database::ConsistencyCheckService).to receive(:new).and_call_original
+ expected_result = { batches: 0, matches: 0, mismatches: 0, mismatches_details: [] }
+ expect(worker).to receive(:log_extra_metadata_on_done).with(:results, expected_result)
+ worker.perform
end
context 'logs should contain the detailed mismatches' do
@@ -37,7 +19,6 @@ RSpec.describe Database::CiNamespaceMirrorsConsistencyCheckWorker do
before do
redis_shared_state_cleanup!
- stub_feature_flags(ci_namespace_mirrors_consistency_check: true)
create_list(:namespace, 10) # This will also create Ci::NameSpaceMirror objects
missing_namespace.delete
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 f8e950d8917..8c839410ccd 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
@@ -6,29 +6,11 @@ RSpec.describe Database::CiProjectMirrorsConsistencyCheckWorker do
let(:worker) { described_class.new }
describe '#perform' do
- context 'feature flag is disabled' do
- before do
- stub_feature_flags(ci_project_mirrors_consistency_check: false)
- end
-
- it 'does not perform the consistency check on projects' do
- expect(Database::ConsistencyCheckService).not_to receive(:new)
- expect(worker).not_to receive(:log_extra_metadata_on_done)
- worker.perform
- end
- end
-
- context 'feature flag is enabled' do
- before do
- stub_feature_flags(ci_project_mirrors_consistency_check: true)
- end
-
- it 'executes the consistency check on projects' do
- expect(Database::ConsistencyCheckService).to receive(:new).and_call_original
- expected_result = { batches: 0, matches: 0, mismatches: 0, mismatches_details: [] }
- expect(worker).to receive(:log_extra_metadata_on_done).with(:results, expected_result)
- worker.perform
- end
+ it 'executes the consistency check on projects' do
+ expect(Database::ConsistencyCheckService).to receive(:new).and_call_original
+ expected_result = { batches: 0, matches: 0, mismatches: 0, mismatches_details: [] }
+ expect(worker).to receive(:log_extra_metadata_on_done).with(:results, expected_result)
+ worker.perform
end
context 'logs should contain the detailed mismatches' do
@@ -37,7 +19,6 @@ 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::ProjectMirror objects
missing_project.delete