Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to run a full MiniTest suite without Rake?
    primarykey
    data
    text
    <p>Looked at <a href="https://stackoverflow.com/questions/4788288/how-to-run-all-the-tests-with-minitest">this question</a> already, and that more or less mirrors how I currently run my whole suite.</p> <p>Additionally, I've setup the following rake task:</p> <pre><code>Rake::TestTask.new do |t| t.name = "spec:models" t.libs &lt;&lt; "test" t.pattern = "spec/models/*_spec.rb" end </code></pre> <p>But I notice when I run this using <code>time rake spec:models</code>, that it completes in about 2.36 seconds. If I run all the individual tests in that directory using <code>ruby /path/to/spec.rb</code> (all are isolated from ActiveRecord currently--no persistance yet, so super fast), their cumulative total user time is 2.36 seconds, yet I'm also noticing while each file takes 0.4 user seconds to execute from start to finish, the actual "test" time reported by MiniTest is much, much faster (such that my whole suite, after loading depencies, should be executing in less than 0.15-ish seconds, not 2.36 seconds).</p> <p>Example (for one spec file):</p> <pre><code>Started 11/11: 100% |======================================| Time: 00:00:00 Finished in 0.02223s 11 tests, 15 assertions, 0 failures, 0 errors, 0 skips ruby path/to/spec.rb 0.43s user 0.06s system 88% cpu 0.559 total </code></pre> <p>I suspect that Rake is reloading libraries between the execution of each test, and that's accounting for the extra time. Is there anyway I can verify this, or run my entire suite without using Rake?</p> <p>Btw, when I say "user time" earlier, I'm referring to the first number outputted by prepending <code>time</code> to my ruby command to run a single test file, so <code>time ruby /path/to/spec.rb</code> = <code>ruby path/to/spec.rb 0.43s user 0.06s system 88% cpu 0.559 total</code></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload