Tuesday, 5 June 2007

How the CI Example From MS Works

Continuous Integration is not built into the current version on TFS, however MS ship an un-official CI solution. I've never had reason to dig into how this worked until the last day or so and thought I'd post what I found.

When the CI example receives a check-in event it queues a new build. It does this by calling QueueUserWorkItem which means it uses the .Net thread pool to do the work. The web service calls QUWI for each unique build type that's been scheduled. So if I have two build types called typeA and typeB, if I schedule typeA and typeB they get separate thread pool threads, one for each type. If while typeA is building and another notification comes in then the build type doesn't get re-scheduled. What happens is that the thread running the typeA build looks at a flag to see if another build has been scheduled for this type. If a build is pending then it simply loops around and runs the next build in the queue. So there's only one build type per thread. If a given build type is already executing and another notification comes in then the build runs again.

This means that each check-in does not kick off a separate build. A build will run after 1 or more check-ins and after the previous build has completed.

Posted by kevin at 4:34 PM in Net

Let's Crush This Myth Now or VSTS does do TDD!

I've just read a post part of which made my blood boil (and I'm not going to link to it but just say that he's not "my very good friend"). The post was comparing VSTS to NUnit and said "Moreover, it's solution inside VSTS is not able to be used in a way that supports TDD as we know it, with its emphasis on generating tests from code." This is complete bullshit. There is nothing inherent in VSTS that stops it supporting TDD. VSTS unit testing is incredibly like NUnit. As an NUnit user (and I am) you can easily move to using VSTS, it's simply a matter of adapting to different attribute names for setting up the tests and different method names for the asserts. In fact it could be argued that with the ability to generate method stubs from within the code VSTS is more able to support TDD than NUnit.

For example I can do this

public void MyTest()
{
   User u = new User();
   u.CallANewMethod();
}

where

CallANewMethod
doesn't exist.

At this point, click on

CallANewMethod
and select 'generate metod stub' and bingo, test driven development. I've written the test and generated stub from the test.

Posted by kevin at 4:14 PM in Net

« June »
SunMonTueWedThuFriSat
     12
3456789
10111213141516
17181920212223
24252627282930