Tuesday, May 29, 2012

Faster RSpec on JRuby with guard-jruby-rspec

The biggest complaint I hear about JRuby is how long it takes to run tests or specs.  I feel your pain.  That's why I started hacking on guard-jruby-rspec.


This guard extention allows you to run all of your specs on JRuby without the initial start up cost.  It does not run a subset of your specs like guard-rspec (yet) and it does not trigger a run when a file changes (yet).  Instead, this extension loads all of your application files in advance, and reloads them individually when they change.  That way, when you run RSpec, the JVM is already running, and your files have already been required.

Here's a short video of me using it:



There's still a lot to do.  For instance:
  • Autorun specs like guard-rspec (want to integrate with guard-rspec so as to not duplicate all of it's logic).
  • Allow for extra rspec options
  • Fix the way guard uses stdin so its not flaky on JRuby
  • Work out the kinks in gj-rspec script so that specs can be run in main terminal.
More to come...

10 comments:

  1. Sounds like this should really be named jruby-spork.

    ReplyDelete
  2. Joe,

    I've put together a similar thing that's just RSpec + Autotest + Nailgun: http://m12y.com/blog/fast-tests-on-jruby/

    Does g-j-r have any obvious advantages over this setup?

    ReplyDelete
  3. michael, i had not seen your post yet. In practice, I don't think there is much advantage to my approach over yours. The only two things I can think of are:
    1) g-j-r preloads everything in addition to warming up the JVM, this saves a couple seconds.
    2) folks might already be using guard for stuff.

    ReplyDelete
  4. Ecorptrainings.com provides JRuby in hyderabad with best faculties on real time projects. We give the best online trainingamong the JRuby in Hyderabad. Classroom Training in Hyderabad India

    ReplyDelete
  5. Thanks for Share These valuable information. It is very useful,about our oracle Online Training is one of the leading Online Training institute.
    Oracle fusion financials training

    ReplyDelete
  6. CALFRE is a local search engine for online and classroom training institute. we have online training for the course
    oracle fusion financials.our oracle fusion financials online training institute Hyderabad, Bangalore, Delhi, Chennai, Kolkata, Pune, Mumbai, Ahmedabad, Gurgon, Noida, India, Dubai, UAE, USA, Kuwait, UK, Singapore, Saudi Arabia, Canada


    Oracle fusion Financials Online Training

    Oracle Fusion Financials online Training

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. This is very usefull information,and for more information like these visit this website
    Oracle Fusion Financials Online Training

    ReplyDelete
  9. I would like to appreciate your work for good accuracy and got informative knowledge from here..................................Click here for More Information about Oracle Fusion Courses.

    ReplyDelete
  10. Casinos Near Casinos in San Francisco, CA
    Explore 전라북도 출장마사지 10 Casinos 영천 출장샵 Near Casinos in San Francisco, CA, near Casinos in San Francisco, CA. 논산 출장마사지 Top 5 Casinos Near by 안산 출장샵 (T-Mobile Park). 포항 출장안마

    ReplyDelete