4 ms·
That's clearly part of the answer: running 1.9.2-p180-patched instead of 1.9.2-p180 drops the total test suite time from 65s down to 52s. But the test suite st
by pbh 15y ago
That's clearly part of the answer: running 1.9.2-p180-patched instead of 1.9.2-p180 drops the total test suite time from 65s down to 52s.
But the test suite still takes 52s, of which only 12s is actually attributable to tests (since rails actually outputs the times for the test portion). FWIW, all of that measured test time seems to be for bcrypt (even with the test-specific initializer to make it faster) rather than persistence anyway.
Thanks for reducing things by 13s, at least. ;-)
EDIT: Actually, it looks like I'm down to 30--40s now, so that helped a lot. Basically, all of the non-test-time seems to be rails environment time (e.g., time bundle exec rake environment) which takes about 6-7s per run (times 3).
- swampthing 15y agoYea, that's pretty much it. I would recommend looking at Spork - it pre-loads the Rails environments (the parts you want it to, at least) onto standing processes that you use to run tests. I consider Rails testing to be pretty much unusable without it.
- pbh 15y agoAh, down to 14s for 100 tests. I had originally avoided spork because it looked rspec only, but I guess there's spork-testunit as well. Thanks!
- arikfr 15y agoSpork is awesome, but has its "gotchas" when it doesn't reload properly. I recommend reading this: https://github.com/timcharper/spork/wiki/Spork.trap_method-Jujutsu https://github.com/timcharper/spork/wiki/Spork.trap_method-J... and applying whatever there is relevant to your project and also using Guard-Spork.