Sha256: 813a2249d68f5d1898a4529601ef444aa8a18b2a19892f1a0657f94189626388

Contents?: true

Size: 607 Bytes

Versions: 202

Compression:

Stored size: 607 Bytes

Contents

module TestTimes
  def self.run(test_results, limit=0)
    limit = limit.nonzero? || 10
    tests = []
    test_results.split(/\n/).each do |line|
      if line =~ /^(.+?#[^:]+): ([0-9.]+) s: \.$/
        tests << [$1, $2.to_f, line]
      end
    end

    puts "#{limit} Slowest tests"
    puts tests.sort_by { |item|
      item[1]
    }.reverse[0...limit].map { |item|
      "%6.3f: %-s\n" % [item[1], item[0]]
    }
  end
end

namespace :test do
  desc "Find the slowest unit tests"
  task :times, [:limit] do |t, args|
    TestTimes.run `rake test:units TESTOPTS='--verbose'`, args.limit.to_i
  end
end

Version data entries

202 entries across 179 versions & 64 rubygems

Version Path
mercadopago-custom-checkout-0.2.0 .gs/gems/rake-10.5.0/rakelib/test_times.rake
video_chat_get-0.1.9 vendor/bundle/ruby/2.5.0/gems/rake-10.5.0/rakelib/test_times.rake
video_chat_get-0.1.6 vendor/bundle/ruby/2.5.0/gems/rake-10.5.0/rakelib/test_times.rake
lotrd-0.1.9 vendor/cache/ruby/2.6.0/gems/rake-10.5.0/rakelib/test_times.rake
lotrd-0.1.8 vendor/cache/ruby/2.6.0/gems/rake-10.5.0/rakelib/test_times.rake
lotrd-0.1.6 vendor/cache/ruby/2.6.0/gems/rake-10.5.0/rakelib/test_times.rake
lotrd-0.1.5 vendor/cache/ruby/2.6.0/gems/rake-10.5.0/rakelib/test_times.rake
video_chat_get-0.1.5 vendor/bundle/ruby/2.5.0/gems/rake-10.5.0/rakelib/test_times.rake
video_chat_get-0.1.4 vendor/bundle/ruby/2.5.0/gems/rake-10.5.0/rakelib/test_times.rake
video_chat_get-0.1.3 vendor/bundle/ruby/2.5.0/gems/rake-10.5.0/rakelib/test_times.rake
video_chat_get-0.1.2 vendor/bundle/ruby/2.5.0/gems/rake-10.5.0/rakelib/test_times.rake
video_chat_get-0.1.1 vendor/bundle/ruby/2.5.0/gems/rake-10.5.0/rakelib/test_times.rake
video_chat_get-0.1.0 vendor/bundle/ruby/2.5.0/gems/rake-10.5.0/rakelib/test_times.rake
josufst_palindrome-0.2.0 vendor/cache/gems/rake-10.5.0/rakelib/test_times.rake
josufst_palindrome-0.2.0 vendor/cache/ruby/2.6.0/gems/rake-10.5.0/rakelib/test_times.rake
josufst_palindrome-0.1.1 vendor/cache/gems/rake-10.5.0/rakelib/test_times.rake
josufst_palindrome-0.1.1 vendor/cache/ruby/2.6.0/gems/rake-10.5.0/rakelib/test_times.rake
nlmt-wrappers-0.0.1 vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/rakelib/test_times.rake
jscop-0.1.2 vendor/cache/ruby/2.6.0/gems/rake-10.5.0/rakelib/test_times.rake
argon-1.3.1 vendor/bundle/ruby/2.7.0/gems/rake-10.5.0/rakelib/test_times.rake