Skip to content

Commit

Permalink
Adjust Sinatra expectations
Browse files Browse the repository at this point in the history
Rack http.url tag now properly takes SCRIPT_NAME into account in the
PATH_INFO case, consistently with REQUEST_URI. These expectations did
not account for that.
  • Loading branch information
lloeki committed Sep 13, 2022
1 parent f439d0e commit ec68ba1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/datadog/tracing/contrib/sinatra/multi_app_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
spans.each do |span|
if span.name == Datadog::Tracing::Contrib::Rack::Ext::SPAN_REQUEST
expect(span.resource).to eq('GET /endpoint')
expect(span.get_tag(Datadog::Tracing::Metadata::Ext::HTTP::TAG_URL)).to eq('/endpoint')
expect(span.get_tag(Datadog::Tracing::Metadata::Ext::HTTP::TAG_URL)).to eq('/one/endpoint')

next
end
Expand All @@ -95,7 +95,7 @@
spans.each do |span|
if span.name == Datadog::Tracing::Contrib::Rack::Ext::SPAN_REQUEST
expect(span.resource).to eq('GET /endpoint')
expect(span.get_tag(Datadog::Tracing::Metadata::Ext::HTTP::TAG_URL)).to eq('/endpoint')
expect(span.get_tag(Datadog::Tracing::Metadata::Ext::HTTP::TAG_URL)).to eq('/two/endpoint')

next
end
Expand All @@ -120,7 +120,7 @@
spans.each do |span|
if span.name == Datadog::Tracing::Contrib::Rack::Ext::SPAN_REQUEST
expect(span.resource).to eq('GET /one/endpoint')
expect(span.get_tag(Datadog::Tracing::Metadata::Ext::HTTP::TAG_URL)).to eq('/endpoint')
expect(span.get_tag(Datadog::Tracing::Metadata::Ext::HTTP::TAG_URL)).to eq('/one/endpoint')

next
end
Expand All @@ -141,7 +141,7 @@
spans.each do |span|
if span.name == Datadog::Tracing::Contrib::Rack::Ext::SPAN_REQUEST
expect(span.resource).to eq('GET /two/endpoint')
expect(span.get_tag(Datadog::Tracing::Metadata::Ext::HTTP::TAG_URL)).to eq('/endpoint')
expect(span.get_tag(Datadog::Tracing::Metadata::Ext::HTTP::TAG_URL)).to eq('/two/endpoint')

next
end
Expand Down

0 comments on commit ec68ba1

Please sign in to comment.