Incorporate Windows Azure unit tests in to TFS Team Builds

November 16, 2009

I’ve started writing “tips” for SearchWinDevelopment.com on Visual Studio, Team Foundation Server, and Unit Testing.  Look for them to trickle out over the next few months.

They’ve posted one that I wrote about making Team Foundation Server Builds work with Windows Azure project.  It’s easy enough to compile Windows Azure projects from Team Build but if you’ve written unit tests that use Windows Azure Storage, you need to do some extra work.  The basic gist is this:

1. Run the Team Build Service in interactive mode
2. After compiling your code and before the unit tests execute, run DevTableGen.exe to initializes your local storage database
3. Start DevelopmentStorage.exe so that your Azure Storage development endpoints are running
4. Run your unit tests

Build and unit test Windows Azure projects from TFS Team Build
by Ben Day
13 Nov 2009 | SearchWinDevelopment.com

One of the great things about Windows Azure is that you can leverage a lot of your existing skills to write cloud-based applications. Want to run ASP.NET applications? No problem. Want to do WCF? Works fine. Windows Azure let's you write and run highly scalable and highly available applications. But what good is a highly scalable Web application if the Web site scales like crazy but the database is super slow? The answer is 'no good at all' and that's why we have the options of Windows Azure Storage and SQL Azure. For this article, we'll focus on Windows Azure Storage.

Windows Azure Storage is a fast, scalable, and reliable storage solution for your Windows Azure applications. With the Windows Azure SDK, you get a version of Azure's cloud server and cloud storage that run on your desktop – DevFabric.exe and DevelopmentStorage.exe, respectively.

Now, just because you're running your applications in the cloud, there's no excuse for not unit testing your application. Arguably, since Windows Azure doesn't allow you to debug your application running on their cloud servers, you almost need unit tests in your development environment even more to make sure that you're catching your errors before you deploy out to the cloud.

Here’s a link to the full article.

Here’s a link to download the Team Build script source code for the article.

-Ben

-- Looking for training on Windows Azure and Windows Azure Storage?  Our Windows Azure Architecture & Development course will be available in February of 2010.  Drop us a line at info@benday.com for more information.

Categories: team-foundation-server-2010 tech windows-azure-services
Tags: team-build tfs tdd