views:

138

answers:

0

I'm trying to publish test results to TFS2010 using MSTest's /publish parameters. MSTest says that the publish was successful, and looking at the SQLServer tables, data for the test has been uploaded. However, the test results do no appear in the TFS Build reports.

If I use TFS to run MSBuild via the default build template, the results do appear in the reports.

I've extraced the parameters that TFS passes to MSTest from the build log, but when using them in a stand-alone MSTest run the results still do not appear in reports.

After some digging in the back-end tables it seems that the TFSDefaultCollection.dbo.tbl_TestBuild table is not being populated with entries for manually published tests. tbl_TestRun and tbl_TestResult do have data for the manually run tests.

I've dug through the DefaultTemplate xaml and cannot see anything special that TFS is doing with regards to MSTest.

Environment: Server 2008R2 x64, SQL Server2008R2 x64, TFS2010 x64

Example manual MSTest run:

"c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe" /nologo /usestderr /testSettings:"C:\Builds\1\FBWorkflow\SimpleLibrary - FB\Sources\SimpleLibrary2\Local.testsettings" /searchpathroot:"C:\Builds\1\FBWorkflow\SimpleLibrary - FB\sources\simplelibrary2\Binaries" /resultsfileroot:"C:\Builds\1\FBWorkflow\SimpleLibrary - FB\sources\simplelibrary2\TestResults" /testcontainer:"C:\Builds\1\FBWorkflow\SimpleLibrary - FB\sources\simplelibrary2\Binaries\SimpleLibraryTest.dll" /publish:"http://localhost:8080/tfs/DefaultCollection" /publishbuild:"vstfs:///Build/Build/14" /teamproject:"FBWorkflow" /platform:"Any CPU" /flavor:"Debug"

Output from that run:

Loading C:\Builds\1\FBWorkflow\SimpleLibrary - FB\Sources\SimpleLibrary2\Local.t estsettings... Loading C:\Builds\1\FBWorkflow\SimpleLibrary - FB\sources\simplelibrary2\Binarie s\SimpleLibraryTest.dll... Starting execution...

Results Top Level Tests Passed SimpleLibraryTest.UnitTest1.TestMethod1 Failed SimpleLibraryTest.UnitTest1.TestMethod2 1/2 test(s) Passed, 1 Failed

Summary Test Run Failed. Passed 1 Failed 1 Total 2 Results file: C:\Builds\1\FBWorkflow\SimpleLibrary - FB\sources\simplelibrary2\ TestResults\ben_TFS2010FULL 2010-05-14 10_49_26_Any CPU_Debug.trx Test Settings: Local Waiting to publish... Publishing results of test run ben@TFS2010FULL 2010-05-14 10:49:26_Any CPU_Debug to http://localhost:8080/tfs/DefaultCollection... ........Publish completed successfully.