Tuesday, September 2, 2008

Growing Test

On my current project(Mingle), we need 9 mins to run pre-commit tests, which is a little bit long for you to keep eyes on the test running status. When I found a rails plugin "Growl Tests", I got it was something I need for my daily work that Growl notification could call me back if I was doing something else during test running. But I don't like install a rails plugin to involve Growl notification for my project, because it is only for developer to run test and I want keep the installer script clean. And also, I need custom notifications for that my first idea was only notifying test fault. So I started another simple project Growling Test.

Later, WPC added test finished notification for getting running test status back in TextMate, which made Growling Test more fun. I don't remember when it happened first time that TextMate didn't output test framework standard output while running test_unit test framework test, but we do painful for no test framework standard output while running tests in TextMate.

Growling Test has 3 notifications registered: test finished, test fault and all test finished. I put test finished notification on my laptop LCD, and put test fault and test finished notification on working monitor. Here is a growling notifications screenshot:



To involve Growling Test in your project, you need install Growling Test gem:
  Run the following if you haven't already:
    gem sources -a http://gems.github.com
  Install the gem:
    sudo gem install xli-growling_test

And then put the following code in your test_helper.rb:
  require 'rubygems'
  require 'growling_test'

Have fun.

0 comments: