I want to optimise a test suite. First I need to know where the time is being spent. As a minimun I want to know how much time is spent in each test.
I came across this gem https://github.com/timocratic/test_benchmark
but is no longer maintained.
Notice that my goal is to benchmark the test suite, not the application.
Is there any other gem that I could use?
Rspec has a minimum functionality profiler included. Have you looked at it? (blog post tutorial for rspec1 but still valid for rspec2)
Basically, if you specify -p
then you get a list of the slowest 10 tests.
Are you familiar with the unix time command? If you're just looking to see how long your test suite took to run you can just prepend the time commmand:
time rake spec
After your rspec output you should see something like
Finished in 5.31 seconds
195 examples, 0 failures, 27 pending
real 0m26.580s
user 0m14.085s
sys 0m2.168s
Of course, this is assuming you're on a *nix platform :-)
-a
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With