Running VSTS tests without mstest.exe

不羁的心 提交于 2019-11-30 03:59:48

You can execute Team System Tests (MSTest) in NUnit if you use a special NUnit Addin that recognizes the MS Test Attributes (TestClass, etc).

Exact Magic Software has an open-source "test-adapter" that can do this.

UPDATE: I've reworked Exact Magic's Msts NUnit Adapter for NUnit 2.5.2.

It seems like TeamCity is simply leveraging Gallio to run VS tests. Gallio appears to have msbuild integration and sounds perfect but after a closer look it seems that it would require a VS install just like MSTest as it appears to depend on MS exes:

The plugin enable condition was not satisfied: '${process:DEVENV.EXE} or 
${process:VSTESTHOST.EXE} or 
${process:QTAGENT.EXE} or 
${process:QTAGENT32.EXE} or 
${process:QTDCAGENT.EXE} or 
${process:QTDCAGENT32.EXE}'.
Host process exited with code: 0

That being said it sounds like at least one person has got it working:

Christoph De Baene - Running MSTest without Visual Studio

quip

It is possible to run MSTests without installing Visual Studio. See how-do-i-use-mstest-without-visual-studio.

I did this so that I could run my tests as part of my CI process. (I am using CC.NET for my CI solution).


I am in a similar situation as you, in that I want to use TestDriven.NET to get code coverage stats. But, I am running into problems. My first problem is that I am using AssemblyInitialize attributes to initialize a database connection. This isn't supported by NUnit so about half of my tests fail whereas they run fine under MSTest.

So, it seems that translating tests from one test framework to another has pitfalls. If you are aware of that, then go forth, but it might be better to try and keep consistent on one test framework.

We run VSTS tests using msbuild TestToolsTask on a Cruise Control server. This does not use the MSTEST executable -- the condition you ask for -- but does use a variety of TFS dependencies.

Note that we are migrating tests off of the VSTS test framework for NUnit, mostly because we can create extensions for NUnit to perform useful tasks.

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