diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 10:34:06 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 10:34:06 +0000 |
commit | 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch) | |
tree | d7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /spec/support/shared_examples/services/repositories/housekeeping_shared_examples.rb | |
parent | 446d496a6d000c73a304be52587cd9bbc7493136 (diff) | |
download | gitlab-ce-859a6fb938bb9ee2a317c46dfa4fcc1af49608f0.tar.gz |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'spec/support/shared_examples/services/repositories/housekeeping_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/services/repositories/housekeeping_shared_examples.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/support/shared_examples/services/repositories/housekeeping_shared_examples.rb b/spec/support/shared_examples/services/repositories/housekeeping_shared_examples.rb index a174ae94b75..4c00faee56b 100644 --- a/spec/support/shared_examples/services/repositories/housekeeping_shared_examples.rb +++ b/spec/support/shared_examples/services/repositories/housekeeping_shared_examples.rb @@ -3,16 +3,16 @@ RSpec.shared_examples 'housekeeps repository' do subject { described_class.new(resource) } - context 'with a clean redis state', :clean_gitlab_redis_shared_state do + context 'with a clean redis state', :clean_gitlab_redis_shared_state, :aggregate_failures do describe '#execute' do it 'enqueues a sidekiq job' do expect(subject).to receive(:try_obtain_lease).and_return(:the_uuid) expect(subject).to receive(:lease_key).and_return(:the_lease_key) expect(subject).to receive(:task).and_return(:incremental_repack) - expect(GitGarbageCollectWorker).to receive(:perform_async).with(resource.id, :incremental_repack, :the_lease_key, :the_uuid).and_call_original + expect(resource.git_garbage_collect_worker_klass).to receive(:perform_async).with(resource.id, :incremental_repack, :the_lease_key, :the_uuid).and_call_original Sidekiq::Testing.fake! do - expect { subject.execute }.to change(GitGarbageCollectWorker.jobs, :size).by(1) + expect { subject.execute }.to change(resource.git_garbage_collect_worker_klass.jobs, :size).by(1) end end @@ -38,7 +38,7 @@ RSpec.shared_examples 'housekeeps repository' do end it 'does not enqueue a job' do - expect(GitGarbageCollectWorker).not_to receive(:perform_async) + expect(resource.git_garbage_collect_worker_klass).not_to receive(:perform_async) expect { subject.execute }.to raise_error(Repositories::HousekeepingService::LeaseTaken) end @@ -63,16 +63,16 @@ RSpec.shared_examples 'housekeeps repository' do allow(subject).to receive(:lease_key).and_return(:the_lease_key) # At push 200 - expect(GitGarbageCollectWorker).to receive(:perform_async).with(resource.id, :gc, :the_lease_key, :the_uuid) + expect(resource.git_garbage_collect_worker_klass).to receive(:perform_async).with(resource.id, :gc, :the_lease_key, :the_uuid) .once # At push 50, 100, 150 - expect(GitGarbageCollectWorker).to receive(:perform_async).with(resource.id, :full_repack, :the_lease_key, :the_uuid) + expect(resource.git_garbage_collect_worker_klass).to receive(:perform_async).with(resource.id, :full_repack, :the_lease_key, :the_uuid) .exactly(3).times # At push 10, 20, ... (except those above) - expect(GitGarbageCollectWorker).to receive(:perform_async).with(resource.id, :incremental_repack, :the_lease_key, :the_uuid) + expect(resource.git_garbage_collect_worker_klass).to receive(:perform_async).with(resource.id, :incremental_repack, :the_lease_key, :the_uuid) .exactly(16).times # At push 6, 12, 18, ... (except those above) - expect(GitGarbageCollectWorker).to receive(:perform_async).with(resource.id, :pack_refs, :the_lease_key, :the_uuid) + expect(resource.git_garbage_collect_worker_klass).to receive(:perform_async).with(resource.id, :pack_refs, :the_lease_key, :the_uuid) .exactly(27).times 201.times do @@ -90,7 +90,7 @@ RSpec.shared_examples 'housekeeps repository' do allow(housekeeping).to receive(:try_obtain_lease).and_return(:gc_uuid) allow(housekeeping).to receive(:lease_key).and_return(:gc_lease_key) - expect(GitGarbageCollectWorker).to receive(:perform_async).with(resource.id, :gc, :gc_lease_key, :gc_uuid).twice + expect(resource.git_garbage_collect_worker_klass).to receive(:perform_async).with(resource.id, :gc, :gc_lease_key, :gc_uuid).twice 2.times do housekeeping.execute |