autotest+mumbles for Growl like notifications
I was working with a colleague today who was kind enough to introduce me to autotest for continuous test integration. Change a file in your app & tests are automatically run for you… Nice.
One thing that really stood out aesthetically was how status messages were passed to Growl (in OSX) for eye-pleasing popup notifications outside of a terminal window.
Being a ubuntu user, I started looking for a similar solution for linux. It turns out there is a great utility for linux that resembles Growl — it’s called Mumbles. The challenge was getting Mumbles to work with autotest.
After searching google, I found one post that got me started. This is a good post, but I had to fill in a few blanks to get everything to work.
Here’s what I did:
- Install ZenTest:
- sudo gem install ZenTest
- Install Mumbles
- grab the latest .deb file or source from the mumbles-project page:
- wget https://sourceforge.net/project/showfiles.php?group_id=193587&package_id=227998
- test out mumbles by running:
- mumbles &
- mumbles-send ‘a title’ ‘it works!!’
- assuming mumbles has been installed correctly, you should see a little notification pop up. I recommend that at this point you add mumbles to your system session so it will start when you login to ubuntu.
- gnome-session-properties
- add -> “mumbles” for name & command -> ok
- Install ruby-dbus. I could not find a gem, so install manually:
- grab the latest from https://trac.luon.net/ruby-dbus/
- wget https://trac.luon.net/data/ruby-dbus/releases/ruby-dbus-0.2.1.tar.gz
- extract the archive to a local directory
- tar -xvf ./ruby-dbus-0.2.1.tar.gz
- look over the README file — it provides simple instructions:
- ruby setup.rb config
- ruby setup.rb setup
- sudo ruby setup.rb install
- test this out by requiring dbus via irb:
- irb
- irb(main):001:0> require ‘dbus’
- => true
- Create a .autotest file in your application root directory (or your home directory to make the settings global) Thanks to CaffinatedCode for this script — they wrote it:
- require ‘dbus’def send_message(title, message, icon)
begin
bus = DBus::SessionBus.instance
mumbles_service = bus.service(“org.mumblesproject.Mumbles”)
mumbles = mumbles_service.object(“/org/mumblesproject/Mumbles”)
mumbles.introspect
mumbles_iface = mumbles["org.mumblesproject.Mumbles"]
sig = mumbles_iface.signals["Notify"]
bus.emit(mumbles_service, mumbles, mumbles_iface, sig, title, message, icon)
rescue Exception => e
end
endAutotest.add_hook :ran_command do |at|
begin
output = at.results.last.slice(/(\d+) examples?, (\d+) failures?(, \d+ pending)?/)
if output =~ /.*[1-9] failure.*/ then
send_message(“FAIL”, “#{output}”, “fail.png”)
else
send_message(“PASS”, “#{output}”, “pass.png”)
end
rescue Exception => e
end
end
Now for the fun part. From within your app root, type:
autotest
If everything works out, you should see a few things flash by – I get a error about “Insecure world writable dir” in my home dir. I just ignored that. After that, you should see a test summary in the terminal window, followed by a mumbles popup notificaton. Kick ass!

joban 10:27 am on December 31, 2008 Permalink |
cool topic .. really helpful !!
khellls 11:09 pm on January 9, 2009 Permalink |
where did u put the icons? cause for me i couldn’t c the icons
Shannon McPherson 12:17 am on January 11, 2009 Permalink |
I think I put the images in the same location as I put the script from step 3 — so either in your application root directory or your home directory. I can’t confirm though, because I traded in my t60 with ubuntu for a nice macbookpro — have not looked back since!
(still running ubuntu on my home machine — but I never configured mumbles on that one)