Skip to content

Commit ef302db

Browse files
committed
Add basic test for trace_context=.
1 parent f9e8bff commit ef302db

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/traces/backend/open_telemetry.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,22 @@ def my_span_and_context
9595
)
9696
end
9797
end
98+
99+
with '#trace_context=' do
100+
it "can update trace context" do
101+
Traces.trace_context = context
102+
103+
span = instance.my_span
104+
105+
expect(span.context).to have_attributes(
106+
trace_id: be == context.trace_id,
107+
)
108+
109+
# It seems like OpenTelemetry doesn't really do anything in the testing environment, so we can't really check the parent_id?
110+
# expect(span).to have_attributes(
111+
# parent_id: be == context.parent_id
112+
# )
113+
end
114+
end
98115
end
99116
end

0 commit comments

Comments
 (0)