简体   繁体   中英

Test suite runs in two batches with MiniTest

In a Rails 4.0.2 app, when running rake test with MiniTest, the tests run in batches, instead of reporting aggregate pass/fail numbers for all tests. That is, the model tests run as one batch, and the integration tests as another. My output from a single invocation of rake test looks like this:

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

This does not occur when I run rake test:all . I tested this with the built-in MiniTest runner and the Turn runner. Both exhibit this behavior.

Is it intentional that MiniTest splits the tests into batches when running rake test but not rake test:all ?

I did a bundle update , and none of my testing gems have a version constraint, so I believe everything is up to date. Gem versions:

  • Rails 4.0.2
  • MiniTest 4.7.5
  • MiniTest Rails 0.9.2

This is intentional in that this is how the rails testing tasks work in rails 3.x. The minitest-rails library overrides the tasks and gives you the old behavior. An upcoming release of minitest-rails will change this and work similar to the rails 4 tasks work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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