Skip to content

Query Reporting: Record the database queries issued during an rspec run

What does this MR do and why?

This is the smallest possible piece of beginning to record queries during rspec runs.

Only enabled in development and test, and only when CI=true, and simply records the raw SQL to an NDJSON log file in the rspec/ folder for future consumption by CI pipelines.

Part of AQA: Record all queries during test runs (&8441 - closed)

How to set up and validate locally

  1. Run an rspec test that queries the database with the CI variable set:
    env CI=true bin/rspec spec/finders/user_finder_spec.rb:18
  2. Check the log file:
    cat rspec/query_recorder.ndjson

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #368739 (closed)

Edited by Matt Kasa

Merge request reports

Loading