Skip to content

Commit

Permalink
Skip cache.hit spec for Rails 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
frederikspang committed Oct 13, 2024
1 parent 73b9c87 commit 537a1ce
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@
end

it "tracks sets cache hit" do
skip("cache.hit is unset on Rails 6.0.x.") if Rails.version.to_i == 6

Rails.cache.write("my_cache_key", "my_cache_value")
transaction = Sentry::Transaction.new(sampled: true, hub: Sentry.get_current_hub)
Sentry.get_current_scope.set_span(transaction)
Expand All @@ -139,7 +141,7 @@

expect(cache_transaction[:spans][1][:op]).to eq("cache.get")
expect(cache_transaction[:spans][1][:origin]).to eq("auto.cache.rails")
expect(cache_transaction[:spans][0][:data]['cache.key']).to eq(["my_cache_key_non_existing"])
expect(cache_transaction[:spans][1][:data]['cache.key']).to eq(["my_cache_key_non_existing"])
expect(cache_transaction[:spans][1][:data]['cache.hit']).to eq(false)
end
end
Expand Down

0 comments on commit 537a1ce

Please sign in to comment.