views:

1353

answers:

2

Similarly to http://stackoverflow.com/questions/954943/how-to-use-mstest-in-continous-integration-without-vs, I want to run mstest.exe on a TeamBuild server.

My context is http://stackoverflow.com/questions/1059230/trapping-error-status-in-msbuild/1059672#1059672 - i.e., I'm only trying to use mstest.exe /publish to upload the results in to the TFS repository. Thus the full rigmarole in http://www.shunra.com/shunrablog/index.php/2009/04/23/running-mstest-without-visual-studio/ is (you'd hope) likely to be overkill, esp as MSTEST.exe, as covered in http://social.msdn.microsoft.com/Forums/en-US/tfsgeneral/thread/e4575890-8f88-413c-a7f3-0d09d3b9cb01 suggests all I need to do is install Team Explorer.

I've installed VS2008 Team Explorer SP1, and mstest.exe /? still isnt telling me about the publish options.

Recall that it says only Team Explorer is required of mstest.exe /? for publishing:

The following options are also available if Team Explorer is installed:

/publish:[server name] Publish results to the Team Foundation Server.

/publishbuild:[build name] The build identifier to be used to publish test results.

/publishresultsfile:[file name] The name of the test results file to publish. If none is specified, use the file produced by the current test run.

/teamproject:[team project name] The name of the team project to which the build belongs. Specify this when publishing test results.

/platform:[platform] The platform of the build against which to publish test results.

/flavor:[flavor] The flavor of the build against which to publish test results.

I'm going down the procmon.exe path to figure out what's missing, but ideally someone in the know would step in and answer:-

Should mstest.exe /publish only require Team Explorer as stated, or does it require VSTT and Team Explorer?

+1  A: 

I've read on the MSDN forums that the /publish functionality of mstest requires purchasing either VS Team Developer or VS Team Test edition. Any lesser editions such as standard/professional or team explorer don't have it.

I'd really like to see some more evidence though, as it seems fairly unreasonable that with "standard" VS2008 you can write and run unit tests, but you arbitrarily can't run them on your build machine :-(

To answer the question:

Should mstest.exe /publish only require Team Explorer, or does it require VSTT and Team Explorer?

It appears that it requires VSTT (which I assume means visual studio team-tester edition)

Orion Edwards
Thanks - the post you cite certainly appears to have a lot of overlap. However IMO, the /publish arm of mstest.exe is a completely different piece to the general test running issue which you mention - this involves having awareness of how to communicate to a TFS, whereas the running tests piece is of course just doing basic reimplementation of what test runners have been doing for 10+ years (BTW even if I didnt explicitly state it in this, getting the tests to run is easy enough by just copying a few bins as covered in other questions I've asked and answered). Thanks for the resp eithher way.
Ruben Bartelink
Running tests works fine, but as far as that thread indicates (and as far as my own testing verifies), the /publish arm of mstest doesn't exist at all unless you have installed VSTS developer or tester edition.
Orion Edwards
Hi, I expanded the post (now including the /? help text, and fixing a broken link). The thrust of my question is "It says it wants _Team Explorer_ in the help - to what extent is it lying, is it really worst case - does it really require TT or TD?). At least in 2010 we'll have a test agent installer... I understand that the notion of publishing ties it to the Team X editions, but to what extent _and why_ ?
Ruben Bartelink
+5  A: 

The /publish option of MSTest.exe does a license check to ensure that a "Team" version of Visual Studio is installed (i.e. the Developer or Test edition) before it does the publish part of the code.

This restriction appears to have been introduced to allow the basic unit testing capabilities in standard versions of Visual Studio but requires you to have one of the more expensive Team editions of Visual Studio to enable the "Team" related features in testing - such as to publish your test results to TFS.

In total there are 3 missing features if you do not have a Team edition of Visual Studio with Team Epxlorer installed.

  • Publishing to TFS
  • Code coverage
  • Connect to remote agent.

If you have the Development Edition installed then you get publish and codecoverage but not the remote agent agent capabilities (i.e. for doing Load lesting).

The Test Edition and Visual Studio Team Suite have everything.

If you would like to see an example of a custom MSBuild task that uses MSTest.exe to publish unit test data from a build server (in this example JUnit test data), then take a look at the Teamprise Build Extensions that I wrote. The source code for these is available under the permissive MS-PL open source license.

Martin Woodward
Ruben Bartelink
Regarding NUnit to trx - have you seen this? http://nunit4teambuild.codeplex.com/ Should hopefully contain the XSLT that you need.
Martin Woodward
Aaron
Aaron - I'll check to make sure, but I'm pretty sure that I've published unit tests from a 2010 Build Agent that only had the build agent installed (i.e. no VS at all, never mind VS Pro). Mind you this was actually an Ant build of a Java project I was doing so probably not the typical use-case :-). Will post back once I get an answer from the test folks.
Martin Woodward
Soon after I posted, I found a pretty clear answer in the Microsoft Visual Studio 2010 Licensing White Paper (as of 2/3/2010): Visual Studio 2010 Professional, Premium, or Ultimate is required [to run a team build] to include unit tests.It would still be greatly appreciated if you get any feedback from your testers. Thanks again!
Aaron