diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-13 12:06:41 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-13 12:06:41 +0300 |
commit | 4f01ac5ba0bf72427ed4fef9b229d056dbb60e89 (patch) | |
tree | 55f2bfd319a18c05ac4e4401c7a0d7b13dd3d74f /spec/workers/expire_build_artifacts_worker_spec.rb | |
parent | 213ce7805856f2cc1d019a03c76ae0d098337c26 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers/expire_build_artifacts_worker_spec.rb')
-rw-r--r-- | spec/workers/expire_build_artifacts_worker_spec.rb | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/spec/workers/expire_build_artifacts_worker_spec.rb b/spec/workers/expire_build_artifacts_worker_spec.rb index 74d6b5605d1..0a0aea838d2 100644 --- a/spec/workers/expire_build_artifacts_worker_spec.rb +++ b/spec/workers/expire_build_artifacts_worker_spec.rb @@ -3,62 +3,11 @@ require 'spec_helper' describe ExpireBuildArtifactsWorker do - include RepoHelpers - let(:worker) { described_class.new } - before do - Sidekiq::Worker.clear_all - end - describe '#perform' do - before do - stub_feature_flags(ci_new_expire_job_artifacts_service: false) - build - end - - subject! do - Sidekiq::Testing.fake! { worker.perform } - end - - context 'with expired artifacts' do - let(:build) { create(:ci_build, :artifacts, artifacts_expire_at: Time.now - 7.days) } - - it 'enqueues that build' do - expect(jobs_enqueued.size).to eq(1) - expect(jobs_enqueued[0]["args"]).to eq([build.id]) - end - end - - context 'with not yet expired artifacts' do - let(:build) { create(:ci_build, :artifacts, artifacts_expire_at: Time.now + 7.days) } - - it 'does not enqueue that build' do - expect(jobs_enqueued.size).to eq(0) - end - end - - context 'without expire date' do - let(:build) { create(:ci_build, :artifacts) } - - it 'does not enqueue that build' do - expect(jobs_enqueued.size).to eq(0) - end - end - - def jobs_enqueued - Sidekiq::Queues.jobs_by_worker['ExpireBuildInstanceArtifactsWorker'] - end - end - - describe '#perform with ci_new_expire_job_artifacts_service feature flag' do - before do - stub_feature_flags(ci_new_expire_job_artifacts_service: true) - end - it 'executes a service' do expect_any_instance_of(Ci::DestroyExpiredJobArtifactsService).to receive(:execute) - expect(ExpireBuildInstanceArtifactsWorker).not_to receive(:bulk_perform_async) worker.perform end |