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.

• For more information about code analysis tools, see “Guidelines for Using Code<br />

Analysis Tools” at http://msdn2.microsoft.com/en-us/library/ms182023(VS.80).aspx<br />

Run Automated Tests on Each Build<br />

Run automated tests to automatically gain feedback on build quality after every build. In<br />

order to create a test list to associate <strong>with</strong> the build you must have either <strong>Visual</strong> <strong>Studio</strong><br />

Test Edition or <strong>Visual</strong> <strong>Studio</strong> <strong>Team</strong> Suite installed. In order to run automated tests on the<br />

build server you must have either <strong>Visual</strong> <strong>Studio</strong> Developer Edition, <strong>Visual</strong> <strong>Studio</strong> Test<br />

Edition, or <strong>Visual</strong> <strong>Studio</strong> <strong>Team</strong> Suite installed on the build server.<br />

To run automated tests as part of the <strong>Team</strong> Build process<br />

1. Create one or more automated tests that you want to run <strong>with</strong> the build.<br />

2. Use the Test Manager to create a Test List.<br />

3. Use the Test Manager to group tests into the new Test List by dragging and dropping<br />

the tests from the Test View to the Test List in the Test Manager.<br />

4. Create a new <strong>Team</strong> Build Type.<br />

5. Select the check box to run automated tests.<br />

6. Select the test project <strong>with</strong>in which your tests and test list were created.<br />

7. Select the test list you want to run.<br />

Additional Resources<br />

• For more information about automatically running build verification tests, see “How<br />

to: Configure and Run Build Verification Tests (BVTs)” at<br />

http://msdn2.microsoft.com/en-us/library/ms182465(VS.80).aspx<br />

• For more information about how to run automated build tests <strong>with</strong>out <strong>Visual</strong> <strong>Studio</strong><br />

Test Edition or a VSMDI file, see “How to run tests in a build <strong>with</strong>out test metadata<br />

files and test lists (.vsmdi files)” at<br />

http://blogs.msdn.com/buckh/archive/2006/11/04/how-to-run-tests-<strong>with</strong>out-testmetadata-files-and-test-lists-vsmdi-files.aspx<br />

Consider Setting Builds to Fail When Automated Tests Fail<br />

When a build fails because of compilation errors, a work item is created to track the<br />

failure and the build is marked as failed. When an automated test fails, however, the build<br />

does not fail. The test failure is converted into a warning and the build continues.<br />

You may want to fail the build if an associated automated test fails. You may also want to<br />

generate a work item automatically to track the test failure.<br />

To fail the build upon test failure<br />

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.

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

Saved successfully!

Ooh no, something went wrong!