sds/db-query-matchers

Configuration to ignore cached queries?

Closed this issue · 4 comments

It'd be nice to have the option to ignore queries that bypass the db and hit the active record query cache. I think in master, there's a payload[:cached] key set to true when it is cached, but in earlier versions I think you just have to look for CACHE in the payload[:name]

This sounds like a good thing to me, but would you mind explaining the use-case a little to me? We generally want deterministic tests, and so my first thought is to find a way to disable the query cache while running tests.

So, I'm using db-query-matchers in some performance related specs. I use it to verify I'm not making an obscene amount of queries in a given endpoint in my app. Its also useful to make sure new changes to the endpoint don't trigger more queries than before. However, I'm only really interested actual database calls in these tests, not duplicate queries that are caught by the query cache.

I have the exact same use case

sds commented

Merged in #47.