Created
April 17, 2009 10:31
-
-
Save chrismcg/96960 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## in test/test_helper.rb | |
class Test::Unit::TestCase | |
alias unlogged_run run | |
def run(result, &block) | |
RAILS_DEFAULT_LOGGER.debug "RUNNING #{self.class} #{@method_name}" | |
start_time = Time.now | |
unlogged_run result, &block | |
time = Time.now - start_time | |
RAILS_DEFAULT_LOGGER.debug "TIME;#{self.class}#{@method_name.gsub(/,/, '')};#{time}" | |
end | |
end if ENV['PROFILE_LOG'] | |
## in shell config | |
alias slow_tests="truncate log/test.log && PROFILE_LOG=1 rake && grep TIME log/test.log | cut -d';' -f2- | sort -t';' -n -k2 -r | head -n 20" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment