Skip to content

Commit

Permalink
Add basic test for trace_context=.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Jan 11, 2025
1 parent f9e8bff commit ef302db
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/traces/backend/open_telemetry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,22 @@ def my_span_and_context
)
end
end

with '#trace_context=' do
it "can update trace context" do
Traces.trace_context = context

span = instance.my_span

expect(span.context).to have_attributes(
trace_id: be == context.trace_id,
)

# It seems like OpenTelemetry doesn't really do anything in the testing environment, so we can't really check the parent_id?
# expect(span).to have_attributes(
# parent_id: be == context.parent_id
# )
end
end
end
end

0 comments on commit ef302db

Please sign in to comment.