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

故事扮演 提交于 2019-12-07 11:36:28

问题


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


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/23620763/how-can-i-generate-a-report-that-shows-me-my-slowest-running-tests-in-rails-3-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!