We need to create tests for N+1 database queries.
Proactive reporting
One of the items is to proactively detect them in CI with bullet or Prosopite. We better do that although we will have to handle false positives/negatives as well.
Enabling test writing for N+1 queries
This is tests for issues like https://github.com/3scale/porta/pull/2954
I have tried writing with `n_plus_one_control` gem but it didn't work. `db-query-matchers` and `rspec-sqlimit` seem to only support rspec at the time of writing.
One side issue here is that in the above example, the extra queries were handled by DB cache. But this still resulted in 3x API call performance loss. So I'm not so sure whether these query counting gems would catch that.
This is a nice article with overview of most of the available options:
https://bhserna.com/tools-to-help-you-detect-n-1-queries.html