【问题标题】:Test suite runs in two batches with MiniTest测试套件使用 MiniTest 分两批运行
【发布时间】:2013-12-17 15:49:17
【问题描述】:

在 Rails 4.0.2 应用程序中,当使用 MiniTest 运行 rake test 时,测试分批运行,而不是报告所有测试的汇总通过/失败数字。也就是说,模型测试作为一批运行,集成测试作为另一批运行。我对rake test 的一次调用的输出如下所示:

Loaded Suite test,test/integration,test/models
# All the model tests run and print their output here
18 tests, 18 passed, 0 failures, 0 errors, 1 skips, 40 assertions

Loaded Suite test,test/integration,test/models
# All the integration tests run and print their output here
5 tests, 5 passed, 0 failures, 0 errors, 0 skips, 24 assertions

当我运行rake test:all不会发生这种情况。我使用内置的 MiniTest runner 和 Turn runner 对此进行了测试。两者都表现出这种行为。

MiniTest 在运行rake test 而不是rake test:all 时是否有意将测试分成批次?

我做了一个bundle update,我的所有测试 gem 都没有版本限制,所以我相信一切都是最新的。宝石版本:

  • Rails 4.0.2
  • MiniTest 4.7.5
  • MiniTest Rails 0.9.2

【问题讨论】:

  • 这很奇怪!套件中的文件是否始终相同?

标签: ruby-on-rails minitest


【解决方案1】:

这是有意的,因为这就是 rails 3.x 中的 rails 测试任务的工作方式。 minitest-rails 库覆盖任务并为您提供旧行为。即将发布的 minitest-rails 将改变这一点,其工作方式类似于 rails 4 任务的工作方式。

【讨论】:

  • 谢谢!这是一个非常直接的答案。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-03-09
  • 1970-01-01
  • 2011-10-15
  • 1970-01-01
  • 2012-12-04
相关资源
最近更新 更多