Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I generate a report that shows me my slowest running tests in Rails 3.2, Ruby 1.9?

I know that RSpec has the --profile option, but I'm only using MiniTest/shoulda for my current project.

like image 659
Farley Knight Avatar asked Dec 04 '22 06:12

Farley Knight


2 Answers

You can use minitest-reporters for this purpose. This gem provide multiple reporters to see output of your tests.

Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new

Spec reporter shows the time which each test take to run. It shows the time on console, not as a report.

like image 173
Malik Shahzad Avatar answered Jan 06 '23 06:01

Malik Shahzad


You can just use:

rake TESTOPTS="-v"

right out of the box. eg:

rake TESTOPTS="-v" test:controllers

I have tested this with Ruby 1.9.3 on Rails 3.2.

like image 42
jpgeek Avatar answered Jan 06 '23 06:01

jpgeek