timocratic / test_benchmark
- Source
- Commits
- Network (5)
- Issues (3)
- Downloads (0)
- Wiki (1)
- Graphs
-
Tree:
c96a0a5
| name | age | message | |
|---|---|---|---|
| |
History.txt | ||
| |
Manifest.txt | Sun Jun 24 21:41:47 -0700 2007 | |
| |
README.textile | ||
| |
Rakefile | Sun Jun 24 21:41:47 -0700 2007 | |
| |
about.yml | Thu Sep 21 10:37:11 -0700 2006 | |
| |
init.rb | ||
| |
lib/ | ||
| |
test/ | Tue Jan 13 10:57:05 -0800 2009 | |
| |
test_benchmark.gemspec |
README.textile
Test Benchmark
A ruby gem and rails plugin to show you how slow your Test::Unit tests run. Useful for troubleshooting/isolating slow tests.
Sample output:
7.124 test_destroy(FeedTest)
7.219 test_create(FeedTest)
7.646 test_subscribe_to_auto_discovery(FeedTest)
9.339 test_auto_discover_updates_url(FeedTest)
9.543 test_find_or_create_by_auto_discover_url(FeedTest)
15.780 test_import_from_opml(FeedTest)
Install and enable
As a Rails Plugin
./script/plugin install git://github.com/timocratic/test_benchmark.git
That’s it. It will also work in rails as a gem (optionally frozen), which then you can add to your your environments/test.rb config.gems
As a Ruby gem
- Update to RubyGems 1.2.0+ before proceeding!!
- gem sources -a http://gems.github.com (you only have to do this once)
- sudo gem install timocratic-test_benchmark
Then in your code:
- require ‘rubygems’
- require ’test_benchmark
Options and disabling temporarily
By default the top 10 slowest tests are output to the console (and in Rails the whole list is dumped to test.log). To see the full dump in your console (as well as get a per-file/suite breakdown) set the env variable BENCHMARK to ‘full’:
BENCHMARK=full rake test
To disable completely, run with it set to ‘false’ instead.

