Tim Huffam

Dotting the I and crossing the T of I.T.

  Home  |   Contact  |   Syndication    |   Login
  153 Posts | 0 Stories | 2747 Comments | 653 Trackbacks

News

Archives

Post Categories

Interesting Blogs/Links

The following will make your builds (running on a TFS Server) execute your unit tests after the build:

  1. Open your build file (eg TFSBuild.proj).  VS2008 has a nice xml editor for this.
  2. Search for the RunTest node and change it from:
    <RunTest>false</RunTest>
    to:
    <RunTest>true</RunTest>
  3. Look for a section that starts with:
    <ItemGroup>
    <!--
    TEST ARGUMENTS ...
    and add nodes within this (after the comments and before the closing of the ItemGroup node) - one entry for each unit test assembly you have eg:
    <TestContainer Include="$(OutDir)\My.App.UnitTests.dll" />

Thats it - check in this file and queue a build.

An error I got while getting this working indicated that the MSTest.exe could not be found - this was because TFS Client had not been installed on the build server - once these were installed it worked fine.

Something else you may want to do is ensure that a build is triggered every time someone checks in.  To do this, edit your build definition (right click on your build within Team Explorer and choose "Edit Build Definition...") - click on the 'Trigger' item in the list on the left and make sure the "Build each check-in (more builds)" item is checked.

HTH
Tim

posted on Tuesday, June 16, 2009 10:54 PM

Feedback

# re: How to turn on unit testing in your TFS build 1/25/2011 8:19 AM squidoo lens creation seo
Interesting post and thanks for sharing. Some things in here I have not thought about before.Thanks for making such a cool post which is really very well written.will be referring a lot of friends about this.Keep blogging

# re: How to turn on unit testing in your TFS build 4/4/2011 3:03 AM free drawing software
Finally found what I was looking for! Thanks man!

# cuteamisha 5/25/2011 2:42 AM international flower delivery sw
Thanks for everything you do on this blog. international flower delivery switzerland

# Loan 10/20/2011 4:48 AM Payday Loan
I got while getting this working indicated that the MSTest.exe could not be found - this was because TFS Client had not been installed on the build server - once these were installed it worked fine.

# Android app developers 11/24/2011 1:26 AM Android app developer
Your informational post is great resource for lots of peoples. so thanks for creating this interesting blog.

# re: How to turn on unit testing in your TFS build 11/25/2011 8:16 AM Cheapbagshopping.com
It is nice of you to post this.I will pay more attention on it.replica women Burberry Highheel shoes from China for sale on line

# re: How to turn on unit testing in your TFS build 4/10/2012 4:45 PM Nandroid Backup
I seriously desired doing so a whole lot. cya substantially for the purpose of showing. Page comprehend a good number of involving whatever you decide to assert here. Continue. Sustain producing.


# re: How to turn on unit testing in your TFS build 12/13/2012 8:38 AM giầy nam
hanks for making such a cool post which is really very well written

# Mr 1/17/2013 2:38 PM Rdnnis Dgefb
Something else you may want to do is ensure that a build is triggered every time someone checks in. To do this, edit your build definition (right click on your build within Team Explorer and choose "Edit Build Definition...") - click on the 'Trigger' item in the list on the left and make sure the "Build each check-in (more builds)" item is checked.oneholiday.de


Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: