instance method report

Ruby on Rails 7.1.6

Since v7.1.6

Available in: v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

report()

No documentation comment.

Source
# File railties/lib/minitest/rails_plugin.rb, line 39
    def report
      total_time = @results.sum(&:time)

      @results.sort! { |a, b| b.time <=> a.time }
      slow_results = @results.take(@count)
      slow_tests_total_time = slow_results.sum(&:time)

      ratio = (total_time == 0) ? 0.0 : (slow_tests_total_time / total_time) * 100

      io.puts("\nTop %d slowest tests (%.2f seconds, %.1f%% of total time):\n" % [slow_results.size, slow_tests_total_time, ratio])
      slow_results.each do |result|
        io.puts("  %s\n    %.4f seconds %s\n" % [result.location, result.time, source_location(result)])
      end
      io.puts("\n")
    end

Defined in railties/lib/minitest/rails_plugin.rb line 39 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Minitest::ProfileReporter

Type at least 2 characters to search.

↑↓ navigate · open · esc close