diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/workers/expire_build_instance_artifacts_worker_spec.rb | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/workers/expire_build_instance_artifacts_worker_spec.rb')
-rw-r--r-- | spec/workers/expire_build_instance_artifacts_worker_spec.rb | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/spec/workers/expire_build_instance_artifacts_worker_spec.rb b/spec/workers/expire_build_instance_artifacts_worker_spec.rb deleted file mode 100644 index 38318447b5f..00000000000 --- a/spec/workers/expire_build_instance_artifacts_worker_spec.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe ExpireBuildInstanceArtifactsWorker do - include RepoHelpers - - let(:worker) { described_class.new } - - describe '#perform' do - before do - worker.perform(build.id) - end - - context 'with expired artifacts' do - context 'when associated project is valid' do - let(:build) { create(:ci_build, :artifacts, :expired) } - - it 'does expire' do - expect(build.reload.artifacts_expired?).to be_truthy - end - - it 'does remove files' do - expect(build.reload.artifacts_file.present?).to be_falsey - end - - it 'does remove the job artifact record' do - expect(build.reload.job_artifacts_archive).to be_nil - end - end - end - - context 'with not yet expired artifacts' do - let_it_be(:build) do - create(:ci_build, :artifacts, artifacts_expire_at: Time.current + 7.days) - end - - it 'does not expire' do - expect(build.reload.artifacts_expired?).to be_falsey - end - - it 'does not remove files' do - expect(build.reload.artifacts_file.present?).to be_truthy - end - - it 'does not remove the job artifact record' do - expect(build.reload.job_artifacts_archive).not_to be_nil - end - end - - context 'without expire date' do - let(:build) { create(:ci_build, :artifacts) } - - it 'does not expire' do - expect(build.reload.artifacts_expired?).to be_falsey - end - - it 'does not remove files' do - expect(build.reload.artifacts_file.present?).to be_truthy - end - - it 'does not remove the job artifact record' do - expect(build.reload.job_artifacts_archive).not_to be_nil - end - end - - context 'for expired artifacts' do - let(:build) { create(:ci_build, :expired) } - - it 'is still expired' do - expect(build.reload.artifacts_expired?).to be_truthy - end - end - end -end |