diff options
Diffstat (limited to 'spec/lib/gitlab/error_tracking/processor')
-rw-r--r-- | spec/lib/gitlab/error_tracking/processor/grpc_error_processor_spec.rb | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/spec/lib/gitlab/error_tracking/processor/grpc_error_processor_spec.rb b/spec/lib/gitlab/error_tracking/processor/grpc_error_processor_spec.rb deleted file mode 100644 index efa88d53f36..00000000000 --- a/spec/lib/gitlab/error_tracking/processor/grpc_error_processor_spec.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Gitlab::ErrorTracking::Processor::GrpcErrorProcessor do - describe '#process' do - subject { described_class.new } - - context 'when there is no GRPC exception' do - let(:data) { { fingerprint: ['ArgumentError', 'Missing arguments'] } } - - it 'leaves data unchanged' do - expect(subject.process(data)).to eq(data) - end - end - - context 'when there is a GPRC exception with a debug string' do - let(:data) do - { - exception: { - values: [ - { - value: "GRPC::DeadlineExceeded: 4:DeadlineExceeded. debug_error_string:{\"hello\":1}" - } - ] - }, - extra: { - caller: 'test' - }, - message: "GRPC::DeadlineExceeded: 4:DeadlineExceeded. debug_error_string:{\"hello\":1}", - fingerprint: [ - "GRPC::DeadlineExceeded", - "4:Deadline Exceeded. debug_error_string:{\"created\":\"@1598938192.005782000\",\"description\":\"Error received from peer unix:/home/git/gitalypraefect.socket\",\"file\":\"src/core/lib/surface/call.cc\",\"file_line\":1055,\"grpc_message\":\"Deadline Exceeded\",\"grpc_status\":4}" - ] - } - end - - let(:expected) do - { - message: "GRPC::DeadlineExceeded: 4:DeadlineExceeded.", - fingerprint: [ - "GRPC::DeadlineExceeded", - "4:Deadline Exceeded." - ], - exception: { - values: [ - { - value: "GRPC::DeadlineExceeded: 4:DeadlineExceeded." - } - ] - }, - extra: { - caller: 'test', - grpc_debug_error_string: "{\"hello\":1}" - } - } - end - - it 'removes the debug error string and stores it as an extra field' do - expect(subject.process(data)).to eq(expected) - end - - context 'with no custom fingerprint' do - before do - data.delete(:fingerprint) - expected.delete(:fingerprint) - end - - it 'removes the debug error string and stores it as an extra field' do - expect(subject.process(data)).to eq(expected) - end - end - end - end -end |