diff options
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/ci/archive_trace_service_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/services/ci/archive_trace_service_spec.rb b/spec/services/ci/archive_trace_service_spec.rb index 6389d7a921f..989aab60113 100644 --- a/spec/services/ci/archive_trace_service_spec.rb +++ b/spec/services/ci/archive_trace_service_spec.rb @@ -11,6 +11,18 @@ describe Ci::ArchiveTraceService, '#execute' do expect(job.reload.job_artifacts_trace).to be_exist end + + context 'when trace is already archived' do + let!(:job) { create(:ci_build, :success, :trace_artifact) } + + it 'ignores an exception' do + expect { subject }.not_to raise_error + end + + it 'does not create an archived trace' do + expect { subject }.not_to change { Ci::JobArtifact.trace.count } + end + end end context 'when job is running' do |