Testfx: Recommended approach to running tests on build server?

Created on 11 Oct 2017  路  4Comments  路  Source: microsoft/testfx

Description

I'm building a new build server for my .NET (primarily 4.6.2) applications with the goal of not needing to install a full copy of Visual Studio. Previously, we were referencing the Visual Studio test assembly in our test projects and invoking mstest.exe during our build process to run the tests. After doing some reading, it sounds like the Microsoft testing world is changing for the better.

I replaced the Visual Studio test assembly with the MSTest.TestFramework NuGet package. However, now my questions are:

  1. How do I invoke my tests? It sounds like vstest.console.exe is needed, however that doesn't appear to come with the Visual Studio Build Tools download. Am I forced into installing a full copy of Visual Studio?
  2. The MSTest.TestFramework package makes a reference to the MSTest.TestAdapter package as being used to execute tests. However, as far as I can tell, it doesn't provide a way to execute the tests? What's the purpose of the TestAdapter package?

Thanks!

question

Most helpful comment

@hickford It's also included in https://www.visualstudio.com/downloads/#agents-for-visual-studio-2017 which is what I used for my build server. Just FYI.

All 4 comments

That is correct. vstest.console is what you need. You could pull in the tooling package from here to run your tests independent of VS. That said, we are also working on an official packaging story here.
The MSTest.TestAdapter package is an extension to the console runner that actually executes tests. MSTest.TestFramework package contains all the framework constructs that test authors can attribute to their test code.
/cc: @pvlakshm

Microsoft Build Tools 2015 included VSTest.Console; Build Tools for Visual Studio 2017 does not. That's frustrating.

Edit: Found vstest.console.exe in https://www.nuget.org/packages/Microsoft.TestPlatform/

@hickford It's also included in https://www.visualstudio.com/downloads/#agents-for-visual-studio-2017 which is what I used for my build server. Just FYI.

Thanks @justaniles, that's useful to know.

Was this page helpful?
0 / 5 - 0 ratings