2

Does anyone know how I can run a .webtest file created by visual studio 2010 through TeamCity?

I have installed the VS Test Agent and can run other types of tests but when i run the .webtest on the TeamCity server with MSTest directly on the command line it says it doesn't recognize the extension. If i run the test on my local box it works fine and completes the test.

Is there something further i need to configure or is this kind of test not directly supported? I'd hate to have to install the whole VS2010 after having already installed the test agent.

If this kind of test is not supported at the command line, is there a way i can invoke it from one of the unit tests i run?

abatishchev
  • 98,240
  • 88
  • 296
  • 433
weblivz
  • 85
  • 6

1 Answers1

2

Sorry, running a webtests (and fakes and loadtests,...) requires an installation of Visual Studio. There is no way around it.

There is a way you can invoke those tests (if you have installed VS ofcourse)

You can use vstest.console.exe located in C:Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe

This is a sample of my PSake script where i use vstest.

In properties i define paths to executable $vstest_path

properties {
...snip...
$mstest_path = "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\MSTest.exe"
$vstest_path = "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe"
$msdeploy_path = "C:\Program Files\IIS\Microsoft Web Deploy V2\msdeploy.exe"
...snip...
}

This is my simplified Task that runs tests using vs-runner

Task VsTests {
    Exec { &$vstest_path /InIsolation "SampleApp.Tests\bin\Debug\SampleApp.Tests.dll" }
}

On the TeamCity side i just use CommandLine Build Step and invoke psake.
Command executable: psake/psake.cmd (i have psake/psake.cmd in my sourcecontrol) Command parameters: VsTest

You could use Powershell build step and invoke PSake from PS too.

Dejan Dakić
  • 2,418
  • 2
  • 25
  • 39