4

I'm simply trying to execute an MSTest project after my build but for some reason I'm getting unmet requirements that state system.MSTest.10.0 exists for my project.

All I did was add a build step, selected Runner type MSTest, selected %system.MSTest.10.0% for my path to MSTest which said it should be detected automatically, then added the reference to my test project library.

What steps am I missing? Do I have to copy over the MSTest executable to some directory? TeamCity's installation documents do not mention any other steps that need to be taken to get this working properly.

Brett Mathe
  • 6,429
  • 7
  • 23
  • 24
  • You can try the VS 2010 Test Agent as described in [this answer](http://stackoverflow.com/a/18092272/39396). – Carl G Jan 29 '14 at 23:59
  • possible duplicate of [Visual Studio required to run MSTest test on Team City Build Server?](http://stackoverflow.com/questions/6926888/visual-studio-required-to-run-mstest-test-on-team-city-build-server) – Carl G Jan 30 '14 at 00:01

3 Answers3

4

There is a solution!

After searching on the internet i've found that other users asked the same question on stackoverflow: Can I use mstest.exe without installing Visual Studio?

I've installed the "agents" from the 2013 version on my build agent and it is working fine now. You do not need the "agent controller" from this package to have a compatible agent.

Community
  • 1
  • 1
dampee
  • 3,392
  • 1
  • 21
  • 37
  • Since 2017, the visualstudio.com downloads page has the Test Agent ready for download at the bottom. Ensure that you run the tests as VSTests, rather than MSTests. – Dr Rob Lang Jun 04 '18 at 13:10
2

From the TeamCity MSTest documentation (in the autodetection section) it looks like you do need to have VS.NET installed on the build server or at have the MSTest.exe.

And again, in the TeamCity Supported Platforms and Environments documentation it clearly states:

MSTest (dedicated build runner; requires appropriate Microsoft Visual Studio edition installed on build agent)

JMason
  • 643
  • 3
  • 7
  • I read the documentation as well and it does state that there are no other prereqs so my question still stands, why doesn't it work out of the box? Why does the build agent say that MSTest does not exist? – Brett Mathe Feb 18 '11 at 22:28
  • The documentation does state that VS.NET is required, I've updated my answer with a link. – JMason Feb 22 '11 at 17:05
1

MStest is installed only with Visual Studio, so like already was said. It's not bundled in Teamcity. Does the agent machine have VS installed? If you want to use that test framework runner then you need to have that. So that agent says that because it's not there. If that's a problem use nunit which Teamcity does come bundled with.

James Woolfenden
  • 6,498
  • 33
  • 53