Running MSTEST.exe /publish on a TeamBuild server, what are the prerequisites?

拜拜、爱过 提交于 2019-11-28 00:21:20

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.

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)

Well, the message you get when running mstest.exe /? is actually very misleading. It tells you that Team Explorer is required to publish your test results, but unfortunately installing Team Explorer doesn't change anything. As Martin stated, MsTest does a license check to ensure that appropriate edition of Visual Studio is installed and thus '/publish' and other switches are not available.

And by 'appropriate' edition MsTest means Premium or Ultimate, not sure about other editions.

Microsoft says you should install Visual Studio on your server to have a fully featured CI and this is the only official and supported solution, but if you really don't like this concept (and I don't), you can make MsTest think that Visual Studio is installed on your server.

It is enough to export some registry keys from your development machine to your CI server and voila! - MsTest does publish your test results to TFS. The registry keys are at HKLM\SOFTWARE\Microsoft\VisualStudio\12.0\Licenses or at HKLM\Software\Wow6432Node\Microsoft\VisualStudio\12.0\Licenses depending on your system.

You can find more details of this solution here: http://blog.foxxtrot.net/2010/02/hacking-mstest-out-of-visual-studio.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!