Skip to content

Commit f1e8d36

Browse files
committed
Add spec
1 parent a403977 commit f1e8d36

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

spec/ddtrace/propagation/grpc_propagator_spec.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,23 @@
8585
expect(subject.origin).to eq 'synthetics'
8686
end
8787
end
88+
89+
# Metadata values can also be arrays
90+
# https://github.com/grpc/grpc-go/blob/master/Documentation/grpc-metadata.md
91+
context 'given populated metadata in array format' do
92+
let(:metadata) do
93+
{ 'x-datadog-trace-id' => ['12345', '67890'],
94+
'x-datadog-parent-id' => ['98765', '43210'],
95+
'x-datadog-sampling-priority' => ['0'],
96+
'x-datadog-origin' => ['synthetics'] }
97+
end
98+
99+
it 'returns a populated context with the first metadata array values' do
100+
expect(subject.trace_id).to eq 12345
101+
expect(subject.span_id).to eq 98765
102+
expect(subject.sampling_priority).to be_zero
103+
expect(subject.origin).to eq 'synthetics'
104+
end
105+
end
88106
end
89107
end

0 commit comments

Comments
 (0)