Ask a questionAsk a question
 

AnswerNunit and TFS Build definitions

  • Wednesday, June 03, 2009 6:53 AMAlexanderSharp Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    In our project we have created Nunit test. Now we want to run these unit test when a teammember checks in his/her code.
    I've created a Build Definition but how can I run my Nunit tests?

    The builds steps say "Running tests" are passed but I got no test results. Even when I check in failing unit tests the build steps say "all passed"

    So, the question: "How can I can Nunit tests during a automatic build with TFS build definitions?"

    In my TFSBuild.proj I have the line:

    <TestContainer Include="$(OutDir)\NUnitTests.dll" />
    where, ofcourse, the .dll is the name of my nunit test project.

Answers

  • Thursday, June 04, 2009 9:00 AMBill.WangMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi Alexander

    The build agent invokes MSTest.exe command line tool during a build to run tests. MSTest.exe doesn't recognize NUnit test assemblies. So MSTest.exe doesn't execute any test methods.

    To integrate NUnit to a team build, please take a look at http://nunit4teambuild.codeplex.com/. I haven't tried it yet. Hope it can help you solve this problem.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.

All Replies

  • Thursday, June 04, 2009 9:00 AMBill.WangMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi Alexander

    The build agent invokes MSTest.exe command line tool during a build to run tests. MSTest.exe doesn't recognize NUnit test assemblies. So MSTest.exe doesn't execute any test methods.

    To integrate NUnit to a team build, please take a look at http://nunit4teambuild.codeplex.com/. I haven't tried it yet. Hope it can help you solve this problem.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.