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.

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. The desktop build task is used<br />

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

5. If you want to create a work item when the build fails, modify the<br />

RunTestWithConfiguration by adding an OnError element just before the closing<br />

tag The OnError element should look like the following:<br />

<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 would like to implement<br />

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

blog 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 a build to create a work item upon test failure,<br />

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 />

Work Items<br />

• Use work items to track build breaks.<br />

Use Work Items to Track Build Breaks<br />

If <strong>Team</strong> Build fails, it automatically creates a work item to track that failure. By default,<br />

the work item will be assigned to ‘Active’ and the title will inform you that there has<br />

been a build failure. You should assign this work item to the responsible developer or<br />

build manager in order to fix the build and resolve the problem.<br />

The build task in TFSBuild.proj that defines this work item looks like the following:<br />

<br />

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

Saved successfully!

Ooh no, something went wrong!