How to determine whether tests passed and building a specific version

Buck Hodges

Aaron Hallberg has written a couple of posts about Team Build that started with questions from users.  The first deals with how to determine, from code, whether tests passed.

Determining Whether Tests Passed in Team Build

In a forum post a while back, I laid out a method for determining whether tests had passed during a build.  More recently, I have linked to this forum post in advising others on similar problems.  Unfortunately, as a sharp user pointed out in this same thread, my solution doesn’t actually work, since it relies on a property that is not accessible in Team Build v1!

So – to remedy the situation I have written a custom task which can be used to determine whether tests have succeeded or not.  This task takes advantage of the GetTestResultsForBuild method of the Microsoft.TeamFoundation.Build.Proxy.BuildStore class.

The second shows you how to build a specific version.

Building a Specific Version with Team Build

Team Build by default gets the latest version of your sources (or tip) from source control.  For the most part, this is probably the behavior you would want and expect.  But not always – you might want to reproduce a particular build that got deleted, for example; or you might want to build your latest changeset without including changes other users might have checked in.

Unfortunately, getting (and therefore building) a specific version from source control is not supported out of the box in Team Build version 1…

tags: , , ,

0 comments

Leave a comment

Feedback usabilla icon