0.03
No commit activity in last 3 years
No release in over 3 years
Outputter to display the slowest tests in a minitest suite
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 5.0
>= 0
 Project Readme

Minitest::Profile

Outputs a list of your 10 slowest tests at the end of a test run:

% ruby test/test_minitest_profile.rb --profile
run options: --profile --seed 4106

# Running:

..................................................

Finished in 1.352722s, 36.9625 runs/s, 36.9625 assertions/s.

50 runs, 50 assertions, 0 failures, 0 errors, 0 skips

================================================================================
Your 10 Slowest Tests
================================================================================

 0.0525ms - a random smattering of tests#test_0050_will take 0.049ms
 0.0507ms - a random smattering of tests#test_0047_will take 0.046ms
 0.0503ms - a random smattering of tests#test_0049_will take 0.048ms
 0.0489ms - a random smattering of tests#test_0048_will take 0.047ms
 0.0486ms - a random smattering of tests#test_0046_will take 0.045ms
 0.0480ms - a random smattering of tests#test_0045_will take 0.044ms
 0.0474ms - a random smattering of tests#test_0044_will take 0.043ms
 0.0464ms - a random smattering of tests#test_0043_will take 0.042ms
 0.0430ms - a random smattering of tests#test_0042_will take 0.041ms
 0.0425ms - a random smattering of tests#test_0041_will take 0.04ms

Installation

Add this line to your application's Gemfile:

gem 'minitest-profile'

And then execute:

$ bundle

Or install it yourself as:

$ gem install minitest-profile

Then add this line to your application's test_helper/spec_helper:

require 'minitest/profile'

Usage

Use the --profile flag to invoke the plugin.

Direct invocation:

`ruby test_thing.rb --profile`

Via rake test runner:

`TESTOPTS='--profile' rake test`

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request