Project Description
Add support for NUnit to TFS 2008's Team Build so that your NUnit test results are visible in the build log and incorporated into the data warehouse for reporting.

Great for teams with an existing investment in NUnit tests, or those who prefer NUnit over other testing frameworks.

To add support for NUnit to your build you need to follow a few simple steps and apply the scripts from this project:

  1. Run Nunit-console and produce an XML log file
  2. Convert the Nunit XML output to an MSTest test results file (with a .trx extension)
  3. Use MSTest /publish to push merge the trx file with an existing build

And then your build logs will look something like this:

clip_image004_thumb4.jpg?imgmax=800

Fortunately there is a sample script that you can include into your build. You then just need to obtain both the XSL Transform (see Releases) and make sure you have the following pre-requisites for your build server:


This release is tested with NUnit 2.4.7

For more information see: http://richardsbraindump.blogspot.com/2008/06/merging-nunit-build-results-into-tfs.html and the developer notes.
Last edited Jun 25 2008 at 5:10 AM by rbanks54, version 5
Comments
cosminonea wrote  Jun 24 2008 at 2:13 PM 
I'm currently looking for a solution to run the NUnit tests on the team system as I only have VS 2008 Pro edition and no VSTS unit tests can be executed on the TFS(2008) unless I have a team edition or suite.

You're solution is partially helping me because I still need VS2008 suite or any team edition to publish the results.

There is a comment to add to your solution though:
If you add the following code(used in enterprise library 3.1 unit tests) to your test files you're going to be able to run the tests with either NUnit or VSTS just by compiling the code with the right switch:

#if !NUNIT
using Microsoft.VisualStudio.TestTools.UnitTesting;
#else
using NUnit.Framework;
using TestClass = NUnit.Framework.TestFixtureAttribute;
using TestInitialize = NUnit.Framework.SetUpAttribute;
using TestCleanup = NUnit.Framework.TearDownAttribute;
using TestMethod = NUnit.Framework.TestAttribute;
#endif

So on the dev machines you can use NUnit and VSTS on the build machine.

I hope they add the unit testing with TFS and no VS installtion should be required on the build server.

Cosmin

lindsve wrote  Today at 11:25 PM 
Any idea about adding code coverage from nunit tests too?

Updating...
© 2006-2009 Microsoft | About CodePlex | Privacy Statement | Terms of Use | Code of Conduct | CodePlex Blog | Version 2008.12.9.14291