26.04.2015 Views

Team Development with Visual Studio Team Foundation Server

Team Development with Visual Studio Team Foundation Server

Team Development with Visual Studio Team Foundation Server

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1. Open the Microsoft.<strong>Team</strong><strong>Foundation</strong>.Build.targets file from Program<br />

Files\MSBuild\Microsoft\<strong>Visual</strong><strong>Studio</strong>\v8.0\<strong>Team</strong>Build.<br />

2. Check out for edit and open the TFSBuild.proj file for the <strong>Team</strong> Build type you want<br />

to have failed upon test failure.<br />

3. Copy the RunTestWithConfiguration target from<br />

Microsoft.<strong>Team</strong><strong>Foundation</strong>.Build.targets to the end of the TFSBuild.proj file, just<br />

before the closing tag.<br />

4. Modify the ContinueOnError attribute from true to false.<br />

Note: There will be two test tool tasks. Modify the end-to-end task in order to only<br />

modify the behavior of builds on the build server. Use the desktop build task when<br />

building on a developer’s desktop.<br />

Alternatively, if you want all <strong>Team</strong> Build types to fail upon test failure, you can modify<br />

Microsoft.<strong>Team</strong><strong>Foundation</strong>.Build.targets directly. This change will modify behavior for<br />

all <strong>Team</strong> Build types.<br />

The solution recommended above is straightforward to implement but is not guaranteed<br />

to continue working for future versions of <strong>Visual</strong> <strong>Studio</strong>. If you want to implement a<br />

solution that is guaranteed to continue working after upgrade, see Aaron Hallberg’s blog<br />

entry “Determining Whether Tests Passed in <strong>Team</strong> Build” at<br />

http://blogs.msdn.com/aaronhallberg/archive/2006/09/21/determining-whether-testspassed-in-team-build.aspx<br />

Additional Resources<br />

• For more information about setting up the build to create a work item upon test<br />

failure, see “Create Workitems for Test Failures in <strong>Team</strong>Build” at<br />

http://blogs.msdn.com/nagarajp/archive/2005/10/14/481290.aspx<br />

• For more information about a solution that is guaranteed to continue working after a<br />

<strong>Visual</strong> <strong>Studio</strong> upgrade, see “Determining Whether Tests Passed in <strong>Team</strong> Build” at<br />

http://blogs.msdn.com/aaronhallberg/archive/2006/09/21/determining-whether-testspassed-in-team-build.aspx<br />

<strong>Team</strong> Build Resources<br />

• For an overview of <strong>Team</strong> <strong>Foundation</strong> Build, see “Overview of <strong>Team</strong> <strong>Foundation</strong><br />

Build” at http://msdn2.microsoft.com/en-us/library/ms181710(vs.80).aspx

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!