Looked at this question and that more or less reflects the way I am currently running my entire package.
In addition, I installed the following rake command:
Rake::TestTask.new do |t| t.name = "spec:models" t.libs << "test" t.pattern = "spec/models/*_spec.rb" end
But I notice when I run it with time rake spec:models
, which completes in about 2.36 seconds. If I run all the individual tests in this directory using ruby /path/to/spec.rb
(all of them are currently isolated from ActiveRecord - there is no stability yet, so very quickly), their total user total time is 2.36 seconds but I also notice that each file takes 0.4 user seconds to run from start to finish, the actual βtestβ time reported by MiniTest is much, much faster (so that my whole package should be executed in less than 0 after loading the download , 15 seconds, not 2.36 seconds).
Example (for one specification file):
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
I suspect that Rake reloads the libraries between each test run, and this takes extra time into account. Anyway, can I test this or run the whole package without using Rake?
By the way, when I say "user time" earlier, I mean the first number obtained by adding time
to my ruby ββcommand to run one test file, so time ruby /path/to/spec.rb
= ruby path/to/spec.rb 0.43s user 0.06s system 88% cpu 0.559 total
source share