diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-11-29 15:13:36 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-11-29 15:13:36 +0900 |
commit | 137541c0414c0cf93170221d11e6a75ed9d89b19 (patch) | |
tree | 95b1151825526157bc19d4cfa4bbc743e7b201df /spec/workers/ci | |
parent | af5bf56857bd6e88bc9ea3322a0873ff6767de69 (diff) | |
download | gitlab-ce-137541c0414c0cf93170221d11e6a75ed9d89b19.tar.gz |
Improve comments
Diffstat (limited to 'spec/workers/ci')
-rw-r--r-- | spec/workers/ci/archive_traces_cron_worker_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/workers/ci/archive_traces_cron_worker_spec.rb b/spec/workers/ci/archive_traces_cron_worker_spec.rb index 4ba3d436e94..478fb7d2c0f 100644 --- a/spec/workers/ci/archive_traces_cron_worker_spec.rb +++ b/spec/workers/ci/archive_traces_cron_worker_spec.rb @@ -48,6 +48,21 @@ describe Ci::ArchiveTracesCronWorker do expect(build2.job_artifacts_trace).to be_exist end end + + context 'when an unexpected exception happened during archiving' do + let!(:build) { create(:ci_build, :success, :trace_live) } + + before do + allow(Gitlab::Sentry).to receive(:track_exception) + allow_any_instance_of(Gitlab::Ci::Trace).to receive(:archive!).and_raise('Unexpected error') + end + + it 'puts a log' do + expect(Rails.logger).to receive(:error).with("Failed to archive trace. id: #{build.id} message: Unexpected error") + + subject + end + end end context 'when a job was cancelled' do |