diff --git a/Gemfile b/Gemfile index 7390283..8c25e84 100644 --- a/Gemfile +++ b/Gemfile @@ -42,4 +42,5 @@ group :development, :test do gem 'rails_best_practices' gem 'rails-erd' gem 'rails-pg-extras' + gem 'active_record_tracer' end diff --git a/Gemfile.lock b/Gemfile.lock index 40200c0..0692493 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -62,6 +62,8 @@ GEM rails-html-sanitizer (~> 1.6) active_record_doctor (1.15.0) activerecord (>= 4.2.0) + active_record_tracer (0.1.0) + activerecord (>= 7.0) activejob (7.2.2.1) activesupport (= 7.2.2.1) globalid (>= 0.3.6) @@ -357,6 +359,7 @@ PLATFORMS DEPENDENCIES active_record_doctor + active_record_tracer activerecord-import (~> 1.5) bcrypt (~> 3.1) benchmark-ips diff --git a/test/test_helper.rb b/test/test_helper.rb index bf906d7..4054d48 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,6 +1,6 @@ ENV['RAILS_ENV'] ||= 'test' require_relative '../config/environment' -require 'rails/test_help' +require 'rails/test_help' # fixtures class ActiveSupport::TestCase # Run tests in parallel with specified workers @@ -39,3 +39,11 @@ class ActiveSupport::TestCase ] ) end + +ActiveRecordTracer.start + +require "minitest/autorun" +Minitest.after_run do + report = ActiveRecordTracer.stop + report.pretty_print(to_file: "tmp/active_record_tracer-tests.txt") +end