We're using TFS 2010 Team Build which automatically runs our unit tests during the build process. If I click on View Log, I can see the list of tests run and each test result (Success/Fail). In the event of Failure, I want to see the test result output (so the developer can figure out what the cause of the failure is). Just running the unit test locally isn't enough because the issue could be environmental (if the test is failing because of some data, server, or physical path).
How can I change my build process template to include the full results of the unit test in the log?
MSTest command line from View Log page:
e:\Program Files\Common7\IDE\MSTest.exe /nologo /usestderr /testSettings:"E:\Builds\1\1\Sources\Source\TestSettings.testsettings" /searchpathroot:"E:\Builds\1\1\Binaries" /resultsfileroot:"E:\Builds\1\1\TestResults" /testcontainer:"E:\Builds\1\1\Sources\Source\Testing\bin\Release\Testing.dll" /publish:"http://tfs:8080/tfs/Projects" /publishbuild:"vstfs:///Build/Build/196" /teamproject:"Project" /platform:"Any CPU" /flavor:"Release"
Screenshot of summary
http://imageshack.us/photo/my-images/28/tfsbuild.gif/
And of the Build Definition configuration
http://imageshack.us/photo/my-images/835/builddefinition.gif/
Thanks.
If you use the default template and run the test using the unit test framework provided by Microsoft, you should be able to see a link to the published test results on the View Summary page of the build details. When you click at this link, the test results will be downloaded from the database and put together in an trx file that will be displayed in your Test Window in Visual Studio.
UPDATE: The problem was figured out after looking at the logs. The build template was customized to use another tool to build instead of MSBuild, and the summary nodes for each configuration (platform/flavor) were not created as a result. That's why the build details view was missing the summary, including the test results.