Skip to content

Commit

Permalink
Limit tested behavior to just cache_key expects
Browse files Browse the repository at this point in the history
Co-authored-by: Marco Costa <[email protected]>
  • Loading branch information
bouwkast and marcotc authored Oct 23, 2024
1 parent 1f31567 commit eb19f98
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions spec/datadog/tracing/contrib/rails/cache_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,22 +128,7 @@
expect(spans).to have(2).items
get, set = spans
expect(get.name).to eq('rails.cache')
expect(get.type).to eq('cache')
expect(get.resource).to eq('GET')
expect(get.service).to eq('rails-cache')
expect(get.get_tag('rails.cache.backend')).to eq('file_store')
expect(get.get_tag('rails.cache.key')).to be_nil
expect(set.name).to eq('rails.cache')

expect(get.get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT))
.to eq('active_support')
expect(get.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION))
.to eq('cache')

expect(set.get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT))
.to eq('active_support')
expect(set.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION))
.to eq('cache')
end
end

Expand Down Expand Up @@ -187,23 +172,7 @@
expect(spans).to have(1 + multi_keys.size).items
get = spans[0]
expect(get.name).to eq('rails.cache')
expect(get.type).to eq('cache')
expect(get.resource).to eq('MGET')
expect(get.service).to eq('rails-cache')
expect(get.get_tag('rails.cache.backend')).to eq('file_store')
expect(get.get_tag('rails.cache.keys')).to be_nil
expect(get.get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT))
.to eq('active_support')
expect(get.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION))
.to eq('cache')

spans[1..-1].each do |set|
expect(set.name).to eq('rails.cache')
expect(set.get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT))
.to eq('active_support')
expect(set.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION))
.to eq('cache')
end
end
end

Expand Down

0 comments on commit eb19f98

Please sign in to comment.