One useful robot

Last year, I was feeling a bit overwhelmed by having to track multiple streams of information all day long. Luckily, I was able to merge two of those streams by combining Team City, our continuous integration tool, with Campfire, our chat room tool.

Using the handy APIs for each of these tools, fellow tester Adrian and I put together our very own Campfire bot. We did already have a Campfire bot implemented in Ruby, but as our team is more familiar with C#, we started from scratch and made a .NET application. We did keep the original name and thus, ‘freshbot’ was reborn.

When we develop new features at Campaign Monitor, there are a few suites of tests that we like to run against each build. These can take up to a total of 10 minutes to complete.

Previously, we’d repeatedly check Team City to see if the tests had completed, then notify the rest of the team in Campfire when we were starting, or stopping test suites. Now we have freshbot monitoring certain builds for us automatically and logging the results in Campfire. Freshbot also lets us know when other environments are building, so we end up with a nice time log of what builds were happening at what time in our Campfire chat room.

Here are a few other useful things we’ve programmed freshbot to do for us:
- Remind us to order our lunch before the cutoff time, and suggest a random sandwich (a randwich) for us.
- Provide us with wisdom.
- Advise us on how to crush our enemies.
- Cheer us up when we’re sad.
- Entertain us with random quotes and images from the movie Zoolander.
- Dazzle us with pointless facts.
- Retrieve random images for us from Bing search, based on keywords.

From time to time, freshbot’s nemesis stalebot has been known to launch a verbal attack on freshbot, mostly consisting of unpleasant sandwich suggestions. We don’t actually know for sure who stalebot’s secret identity is, but we have our suspicions.

After a few days of running and refining freshbot, I noticed that it was crashing overnight. So I added some exception handling and logging to see what the problem was. I found out that Team City undergoes maintenance at the same time every night, so any calls made to the server during this period would return errors. Having discovered this, I decided to check on some of the “random” failures that we’d been encountering in our nightly automated test runs and, as I’d suspected, some of them were coinciding with this maintenance time. By rescheduling the test runs, we were able to avoid these failures.

As freshbot would say, “Our greatest glory is not in never falling, but in rising every time we fall.” Thanks, freshbot.

>> Want to work in a place like this? Campaign Monitor is hiring!

One thought on “One useful robot

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>