Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Msbuild.exe to pushing Test results to TFS 2010, but no results in TFS


Symptoms

Using
Mstest.exe
to run a collection of unit tests and push the results into TFS gives the following output as expected:


MSTest command:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\mstest.exe" /testcontainer:C:\temp\AnyCPU\Release\TestAssembly.dll /publish:http://tfsserver:8080/tfs/prod /TeamProject:ProjectName /publishbuild:1.2.3.4.5 /platform:AnyCPU /flavor:Release
Output:
Summary
-------
Test Run Completed.
Passed 15
----------
Total 15
Results file: C:\temp\MachineName 2012-04-17 18_57_48_AnyCPU_Release.trx
Test Settings: Default Test Settings
Waiting to publish...
Publishing results of test run alias@machinename 2012-04-17 18:57:48_AnyCPU_Release to http://tfsHost:8080/tfs/prod.
..
........Publish completed successfully.

However, the results are not visible in TFS associated with the build.

↑ Back to the top


Cause

In order to properly associate the test results with a build, the value for the /platform tag must be specified exactly. Incorrect flags will result in a success message from MSTest.exe, but the results will not be placed anywhere that they can be retrieved in TFS.

↑ Back to the top


Resolution

In the command above the AnyCPU platform flag is used, but the value should be "Any CPU"

The resulting correct command in this instance would be:

"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\mstest.exe" /testcontainer:C:\temp\AnyCPU\Release\TestAssembly.dll /publish:http://tfsserver:8080/tfs/prod /TeamProject:ProjectName /publishbuild:1.2.3.4.5 /platform:"Any CPU" /flavor:"Release"


↑ Back to the top


Keywords: kb

↑ Back to the top

Article Info
Article ID : 2704782
Revision : 1
Created on : 1/7/2017
Published on : 4/20/2012
Exists online : False
Views : 149