views:

48

answers:

2

The usual sob story: my tests are running slowly.

My first thought was to profile the whole test suite to look for obvious wins (stubbing out network access or caches), so I added a ruby-prof task:

RubyProf::ProfileTask.new(:units) do |t|
  t.test_files = FileList[RAILS_ROOT + '/test/unit/**/*_test.rb']
  t.output_dir = Dir.tmpdir
  t.printer = :graph
  t.min_percent = 1
end

Unfortunately, this profiles each test individually. Is there a way to get an aggregate over all of those test classes?

+2  A: 

You can run ruby-prof test_suite_name.rb. You don't even need to add any ruby-prof specific code to your tests.

Andrew Grimm
+1  A: 

There are plans to add benchmarking to minitest.

Andrew Grimm