views:

712

answers:

1

I am trying to setup a TeamCity 4.0 build server to run VS2008 (non-TFS) unit tests.

If I manually create a test list and maintain the list so all unit tests created are included in the list, I can use the "/testlist:mylist" option to run all the tests automatically on the build server.

But maintaining the list itself will be a problem once project development kicks off. So I am looking for a way to tell MSTEST to just "load all tests you can find in this folder", is this possible?

One workaround will be to specify the test assembly to run. But that is not too different from maintaining a "all" test list.

Is it possible to tell MSTEST.exe to just load all tests it can find? Anyone with experience? I am kind of new to this but I need it to be automated.

+1  A: 

I use TC4 + NUnit using an MSBUILD script (which runner are you using?), and do explicit runs like:

<NUnit Assemblies="Test/bin/$(Platform)/$(Configuration)/Product.Test.dll" Platform="x86" />

But there's no reason why you can't do an ItemGroup or use CreateItem to create a list of all DLLs matching a pattern and run it that way.

In general you are correct in assuming that [TeamCity] runners (which are generally quite well documented) definitely don't need explicit lists of tests, no matter how easily you can generate them.

Ruben Bartelink
I am using sln2008 build runner since I have VS2008 Pro on the build server. I've tried using wildcards in the assemblies list but TeamCity just supply it to MsTest literally... so ItemGroup seems a promising option.
chakrit
if you create a msbuild script you can just chain to the sln by doing <Target Name="Compile"><MSBuild Projects="Solution.sln"/></Target> and then run the tests from there too. (you can use **\*.Test.Dll etc.)
Ruben Bartelink
guess MSBuild is the way to go... duh!
chakrit