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

2

5

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

Paterson answered 12/5, 2014 at 23:56 Comment(0)
G
9

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.

Gondolier answered 26/8, 2014 at 12:52 Comment(0)
L
9

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.

Loar answered 27/8, 2015 at 20:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.