summaryrefslogtreecommitdiff
path: root/spec/workers/ci
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-11-29 15:13:36 +0900
committerShinya Maeda <shinya@gitlab.com>2018-11-29 15:13:36 +0900
commit137541c0414c0cf93170221d11e6a75ed9d89b19 (patch)
tree95b1151825526157bc19d4cfa4bbc743e7b201df /spec/workers/ci
parentaf5bf56857bd6e88bc9ea3322a0873ff6767de69 (diff)
downloadgitlab-ce-137541c0414c0cf93170221d11e6a75ed9d89b19.tar.gz
Improve comments
Diffstat (limited to 'spec/workers/ci')
-rw-r--r--spec/workers/ci/archive_traces_cron_worker_spec.rb15
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