In the land of Continuous Integration
So I've been keeping pretty quiet lately, mostly from a lack of anything too exciting in my life, but I thought it might be interesting to discuss what I've been doing at work on and off for the last month.
Basically, a while ago I got our support guys to make me a Build Server on our Virtual Server farm, and I've finally gotten to the point I have found a few hours here and there to have a play with it.
So at work we have Sourcegear's Vault Source Control which works beautifully for what we need. We're a pretty small team that can't spend a lot of time going out and maintaining our tools and Vault seems to manage us way more than we manage it.
So we have our code safely locked away and under control, and we have fairly good standards as far as our internal frameworks and coding standards, but we're pretty slow on the uptake of anything agile or in the realm of Test Driven Development - and not because we're not interested, but more the fact that our dev team is split between our business units and we're developing for our own sections, and there's really one or two guys working their area - to remain quick we haven't really been agile (if that makes sense).
Right now we're going through a bit of a period where we're really taking a look at how we can do things smarter, build a system that manages us a little bit more, so we can spend the time actually making things that just work.
So Unit Tests are one thing we'll be trying to do better at over time, but since I had the time I got Cruise Control .NET up and going on our build server so we can work across the groups a little, work on the same projects a little more, and automate our tests and code checkups a little to make it quicker for us to develop, but still maintain complete coverage of our testing.
It's integrating fine with Vault, and we have it building great - however, I was finding it hard to get FxCop to run without causing a build failure. Even though I'm using MSBuild for build tasks, I have ended up installing NAnt and using similar code to the block found on the Cruise Control .NET website to run FxCop.
We're using MsTest to do our testing due to the great integration with Visual Studio 2008, however, it doesn't integrate as well with Cruise Control .NET as far as showing results - it might be a case of having to dig into the XSL templates to better understand how the results and statistics are being displayed.
Currently we're running MsTest as advised with a batch file, again from the Cruise Control .NET documentation, but since we've started using NAnt for FxCop, I might swap that over to be run from NAnt as well.
The other thing I'd love to check out is NDepend, however, I think the cost might be a barrier - at the moment the company is sticking to a needs only purchase scheme, and this is just a nice to have. There's a good mini-review over on Keyvan Nayyeri's blog and he recommends, so I might give the trial version a run and see if the other guys on the team find it valuable.
So what do we get for all this?
- The ability to have a build run automatically after a check-in to the source control, so if someone doesn't "Get Latest Version" or if we have a few guys covering the same code and something arises, we find out straight away.
- We get our tests run every time we check-in updates - and we don't have to spend the cycles waiting for our development machines to do them.
- We get FxCop, and maybe NDepend, coverage information on where we're not adhering to standards, and again we're not spending the cycles on our own machines.
- We get to find out who checked in the code who broke the build, and which files, so we can go into Vault straight away to do a compare and find out what's new, and what is the probable cause.
- A simple dashboard tool that can show where all our projects are up to - no matter who is adding to it.
- Better statistic, testing, and reporting whenever we update our codebases.
I know this post has been a bit of a rant, and more of a "where I'm up to" rather than a helpful post... but I'd definitely recommend having the build server - if you don't have a build server, and even a small team that's working across the same code... even if you can't build a server, find a spare slower PC and just use that.
Remember, the build server won't be doing much other than waiting and then spending a bit of time now and then compiling and testing your code - so it doesn't need to be a beast.
It really is a simple matter to set up the software, and the build scripts are fairly simple at their basic levels - the only thing I'd like to see is the ability to separate projects into their own configuration files (at the moment they share one for Cruise Control).
Anyway, I might do a more helpful post later on - but if you want to contact me to ask any questions about this configuration, or some help setting it up - feel free to drop a comment!
