简体   繁体   English

每个测试在Ruby on Rails中运行需要多长时间?

[英]How long does each test take to run in Ruby on Rails?

Is there a way to get a report of how long each test is taking to run on a Ruby on Rails project? 有没有一种方法可以报告每个测试在Ruby on Rails项目上花费多长时间? I have aa small set of tests, 2 or 3, which take about 50% of the time and I'd like to find out which ones are. 我有少量的测试,即2或3个测试,大约需要50%的时间,我想找出是哪个。

Ideas of the top of my mind: 我最高思想的想法:

  1. test_benchmark: http://github.com/timocratic/test_benchmark test_benchmark: http ://github.com/timocratic/test_benchmark
  2. test_benchmarker: http://github.com/myronmarston/test_benchmarker/ test_benchmarker: http ://github.com/myronmarston/test_benchmarker/
  3. If you are running rspec, you can use the command --format profile will give you the top 10 slowest tests 如果您正在运行rspec,则可以使用命令--format profile将为您提供最慢的10个测试
  4. You could write data ... somewhere during setup and teardown of a test. 您可以在设置和拆卸测试期间在某处写入数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM