Team System Rocks

Unit Test Execution - Part 2

In my first posting in this thread I discussed some of the issues around executing unit tests as part of Team Build. In this entry I will look at how the custom create test list task I have created works.

I first started looking at this task by checking if I could create a test list using the built in .Net assemblies. Unfortunately the test list class is marked as internal, so I had to be a bit more creative.

Without the use of the test list class I did the following:

  • Investigated how unit test methods are identified.
  • Inferred a XSD from the test list XML.
  • Modified the XSD to create a C# class.
  • Created a framework that:
    • Uses reflection to find TestMethods from a compiled test assembly.
    • Creates test categories.
    • Adds tests to a default ‘generated’ category.
  • Serializes the information to create a vsmdi test list file.
  • Created a custom MSBuild task to wrap the new test list functionality.

Having generated a vsmdi test list file I then changed the build project in the following ways:

  • Imported the custom build task from a build targets file.
  • Changed the RunTest to true.
  • Changed the MetaDataFile property to include the generated vsmdi test list file.
  • Added an AfterCompile build target that calls the custom CreateTestList task.

The result is a vsmdi test list file that can used by the Team Build testing process to execute all test methods in a single test assembly.

I am currently in the process of looking at setting up a GotDotNet workspace to host the MSI files and the source code. If you would like to act as beta tester before release please contact me and I will send you a copy of the install MSI.

In the next post in this thread I will look at:

  • How the custom task is deployed via an MSI file.
  • Possible future improvements to enhance the process.

Posted Feb 10 2006, 09:40 AM by Grant Archibald

Comments

The Software Lifecycle Blog wrote Executing VS Unit Tests on the Team Build Server
on 02-11-2006 11:22 AM
One of the issues frequently encountered in the interaction between Visual Studio Unit Testing and...
The Software Lifecycle Blog wrote Executing VS Unit Tests on the Team Build Server
on 02-11-2006 11:23 AM
One of the issues frequently encountered in the interaction between Visual Studio Unit Testing and...

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Powered by Community Server (Commercial Edition), by Telligent Systems