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

发布于 2024-08-27 06:44:33 字数 90 浏览 3 评论 0原文

有没有办法获得有关在 Ruby on Rails 项目上运行每个测试需要多长时间的报告?我有一小组测试,2 或 3 个,大约需要 50% 的时间,我想找出哪些是测试。

Is there a way to get a report of how long each test is taking to run on a Ruby on Rails project? I have a a small set of tests, 2 or 3, which take about 50% of the time and I'd like to find out which ones are.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

铃予 2024-09-03 06:44:33

我的想法:

  1. test_benchmark: http://github.com/timocratic/test_benchmark
  2. test_benchmarker : http://github.com/myronmarston/test_benchmarker/
  3. 如果您正在运行 rspec,则可以使用命令 --format profile 将为您提供前 10 个最慢的测试。
  4. 您可以在测试的设置和拆卸过程中将数据写入...某处。

Ideas of the top of my mind:

  1. test_benchmark: http://github.com/timocratic/test_benchmark
  2. 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
  4. You could write data ... somewhere during setup and teardown of a test.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文