summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2019-05-10 16:12:33 -0500
committerBob Van Landuyt <bob@vanlanduyt.co>2019-05-13 13:27:41 -0500
commit4c2f6814907f3988c86c9f79a155d1d48ba61793 (patch)
treeeee0368269fc9065c81bb767d6df60b35fa02891 /spec/lib/gitlab
parent9dc41a0993a38f99eeda9c2e8bb3ace070003496 (diff)
downloadgitlab-ce-4c2f6814907f3988c86c9f79a155d1d48ba61793.tar.gz
Add correlation id to all sentry errors
Before this, we were only adding the correlation id to the "acceptable exceptions" which we handle in code. But we need to add it to the default raven context so the information would be available for uncaught exceptions.
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r--spec/lib/gitlab/sentry_spec.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/lib/gitlab/sentry_spec.rb b/spec/lib/gitlab/sentry_spec.rb
index ae522a588ee..af8b059b984 100644
--- a/spec/lib/gitlab/sentry_spec.rb
+++ b/spec/lib/gitlab/sentry_spec.rb
@@ -2,12 +2,15 @@ require 'spec_helper'
describe Gitlab::Sentry do
describe '.context' do
- it 'adds the locale to the tags' do
+ it 'adds the expected tags' do
expect(described_class).to receive(:enabled?).and_return(true)
+ allow(Labkit::Correlation::CorrelationId).to receive(:current_id).and_return('cid')
described_class.context(nil)
expect(Raven.tags_context[:locale].to_s).to eq(I18n.locale.to_s)
+ expect(Raven.tags_context[Labkit::Correlation::CorrelationId::LOG_KEY.to_sym].to_s)
+ .to eq('cid')
end
end