Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rspec Still Slow On Windows Even With Spork

I have followed this tutorial on speeding up rspec with spork, and I am on a win7 x64 box with ruby 1.9.2 and rails 3.2.5. Everything is working, but test still execute slowly. Does spork simply not do much on windows because the OS doesn't support forking?

Is there anything else I can do to speed things up?

I also found this similar SO question, and watched the video by Corey Haines on fast testing. I enjoyed the video, but I can't help feeling that something is off when the state of our tools (slow tests due to rails startup time, in this case) dictates how we structure our code. If that slow startup time didn't exist, would there be any need for his methods? On the other hand, with tests taking 10-30 seconds to run, so many of the benefits of TDD are lost that I see his point of view as well.

In case it's relevant, here's the console output from spork as the rspec was executed a couple times:

    $ bundle exec spork
Using RSpec
  -- Starting to fill pool...
     Wait until at least one slave is provided before running tests...
  ** CTRL+BREAK to stop Spork and kill all ruby slave processes **
Spork is ready and listening on 8989!
  -- Rinda Ring Server listening for connections...

   -- build slave 1...
Preloading Rails environment
   -- build slave 2...
Preloading Rails environment
Loading Spork.prefork block...
Loading Spork.prefork block...
Running tests with args ["--color"]...
  --> DRb magazine_slave_service: 1 provided...
  --> DRb magazine_slave_service: 2 provided...
  <-- take tuple(2); slave.run...
   -- (2);run done
Done.

   -- build slave 2...
Preloading Rails environment
Loading Spork.prefork block...
Running tests with args ["--color"]...
  <-- take tuple(1); slave.run...
   -- (1);run done
Done.

   -- build slave 1...
Preloading Rails environment
Loading Spork.prefork block...
  --> DRb magazine_slave_service: 2 provided...
like image 636
Jonah Avatar asked Jun 19 '12 09:06

Jonah


2 Answers

The Code Shop is building an MRI Ruby optimized for Windows, you can find more about it on their Website or their Github Repo.

I also suggest you to watch this talk about developping rails apps on Windows

like image 160
systho Avatar answered Nov 14 '22 22:11

systho


Try checking out http://railscasts.com/episodes/413-fast-tests. This shows a lot of different tools that can improve the speed of your test suite significantly!

like image 1
jokklan Avatar answered Nov 14 '22 23:11

jokklan