class ParallelTests
def self.tests_with_runtime(root)
def self.tests_with_runtime(root) tests = find_tests(root) lines = File.read('tmp/parallel_profile.log').split("\n") rescue [] # use recorded test runtime if we got enough data if lines.size * 1.5 > tests.size puts "Using recorded test runtime" times = Hash.new(1) lines.each do |line| test, time = line.split(":") times[test] = time.to_f end tests.sort.map{|test| [test, times[test]] } else # use file sizes tests.sort.map{|test| [test, File.stat(test).size] } end end