How to use MsTest in Continuous Integration without VS?

老子叫甜甜 提交于 2019-12-19 05:15:24

问题


I my problem is quite simple, i have a CI server wich run msbuild and mstest.

The problem is that the Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll doesn't exist( and i thinks other file related to mstest...) if we don't install VS in the server wich is pretty stupid for a CI server...

Anybody have a solution about this problem ?


回答1:


Unfortunately, there is no supported or easy way around having to install VS on the build agent machine in 2005 or 2008 (There will be a test agent installer in 2010). UPDATE: See this post from Steve Smith for more info which says pretty much the same thing

It's not just a matter of the assemblies being missing - if you want to run the tests, the runner is not just a separate little EXE and a DLL.

Yes, hard to believe! Needless to say, very few other test frameworks on the planet have this restriction, so unless you have a lot of tests, you could consider moving, for a variety of reasons which are covered in many places, example: The fundamental problems and impracticality of using MSTest...

EDIT: Prompted by Rihan's reply, I binged up the following Running mstest without Visual Studio. - It's not fully supported, but it 'works'...

EDIT 2: Running MSTest without Visual Studio - Gallio to the rescue looks a lot more promising in terms of being supported and non-hacky. NB see @Johannes Rudolph's comment on this post tho'

EDIT 3: Added info re 2010 status on this question

NOTE: I have a similar question for 2008 regarding what's required to support the /publish parameter of MSTest:- Running MSTEST.exe /publish on a TeamBuild server, what are the prerequisites?




回答2:


@Ruben Bartelink : You can get mstest.exe in your machine by installing test agents. you can find it @given location. Post installation, invoke mstest.exe with /testcontainer and /test options. It runs successfully and creates trx files. Check for something which can process trx and generate reports.

http://www.microsoft.com/en-us/download/details.aspx?id=38186




回答3:


The specific solution for me and a Visual Studio 2010 was:

  1. Install "Test Agent 2010" from Visual Studio Agents 2010
  2. Restart Windows
  3. Install Visual Studio 2010 Service Pack 1
  4. Restart Windows
  5. Ensure the projects References are updated to point at "Microsoft.VisualStudio.QualityTools.UnitTestFramework" "10.1.0.0" and not "10.0.0.0".



回答4:


We have Cruise Control setup on our integration server. I have not installed visual studio, however I have copyied the MSTEST assemblies into the GAC. We then used Cruise Control Documentation to setup our test reports. Works very well.



来源:https://stackoverflow.com/questions/954943/how-to-use-mstest-in-continuous-integration-without-vs

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