I have created custom build tasks in my project file to run my nUnit tests, convert them to the MSTest result format using an XSLT and call mstest /publish with all the appropriate parameters. The build appears to be successful but I don’t get any test results in the build report.
PublishNUnitReportToTfs: “C:\Program
Files (x86)\MSBuild..\Microsoft
Visual Studio
10.0\Common7\IDE\mstest.exe” /publish:”http://TFSBuildServer:8080/tfs/Acme
Development”
/publishbuild:”ci2.myApp.acme.com_20110526.15″
/publishresultsfile:”D:\Builds\2\myApp\ci2.myApp.acme.com\Sources\myApp.Core.nUnit.Tests..\nUnitResultsAsMsTestResults.xml”
/teamproject:”myApp”
/platform:”AnyCPU” /flavor:”Debug”
Microsoft (R) Test Execution Command
Line Tool Version 10.0.30319.1
Copyright (c) Microsoft Corporation.
All rights reserved.
Waiting to publish… The file
‘D:\Builds\2\myApp\ci2.myApp.acme.com\Sources\nUnitResultsAsMsTestResults.xml’
was created in an earlier version of
Visual Studio. This file will be
converted, in memory only, to the
current format. Publishing results
of test run tfssvc@TFSBuildServer
2011-05-26 15:47:54 to
http://TFSBuildServer:8080/tfs/Acme
Development… ………..Publish
completed successfully.
Am I missing something?
I found it!
After running the Build Quality Indicators report and playing with the report parameters I noticed there was an odd platform value, “AnyCPU” in addition to “Any CPU”. Then I checked the TFS warehouse database and found that my test results were making it to the database. So I changed the platform flag on the mstest call to the static value “Any CPU” instead of using the $(Platform) build property and that fixed it.
Hope this helps someone else.