VSTest is a very extensible unit test execution framework. The base engine, discovers tests and runs them. It can parallelize across cores, provides process isolation and can integrate with Visual Studio. It has extensibility for different test frameworks, code coverage, test impact analysis, data collection, test result reporting and much more.

To give you a little context on what I’m talking about I’ve put together an architecture diagram. The pieces we open sourced yesterday are in yellow. My diagram of the end to end solution includes clients like VS and VSCode (and others) on the left – though you can just use the command line directly and just skip that swim lane. We released our cross platform runner and the host process that discovers, loads and runs the tests.

Tests generally use some test framework and vstest supports many. Many of the test adapters are open source or available as NuGet packages. You can checkout the VS marketplace for a sampling of them. We did not open source any new adapters with this release – but we don’t even build most of them. The big one we do build is MSTestV2 and VERY MANY people use it. We did not open source that framework at this time but we plan to in the next few months – it just wasn’t ready at this time.

If you use unit testing in VS, there’s a good chance you use this infrastructure already. If you are using the unit testing capabilities that have been delivered in the .NET Core previews, you are also using it. Now it is open source so you can see how it works and, ultimately, contribute to it. We have not yet opened up the project for contributions but we will. Again, crawl, walk, run.

Tags

Join the conversation

Great news ! – I’ve just started integrating my test platform in to TFS but before I get to the stage you’re mentioning here I want to just get my results into TFS whilst still using my internal test tool to actually run the test, but i’ve run across a bit of a snag….

I am trying to add test points to an existing test run using the c# bindings to the REST API, I’ve included a sample of my code below.

In reality, the test run would have been created beforehand. When this is run, AddTestResultsToTestRunAsync returns an error that states “AutomatedTestName must be specified for automated test runs when neither TestPointId nor TestCaseId has been specified”. I am not trying to create an automated test – I simply want to add the test point to the test run.

Thanks in advance,

1 year ago

Rich Woods

Will you open source the codedUI part of the MSTest Framework? Great news!

1 year ago

Noneedforaname

Dear Microsoft,
nice work, but off topic: please add a function to all your office programs to export a view WITHOUT spell check highlighting!

Open source CodedUI would have been nice.
I hate to say it but people mostly moved away from VS Test some time ago already, so the only good thing it has to offer is CodedUI. Open sourcing CodedUI is really important because of continuous integration tools. Right now we cannot for example run our CodedUI tests on platforms like AppVeyor because it has Visual Studio Community and therefore lacks CodedUI which is only avalaible in Enterprise version. Open sourcing it would mean greater adoption of this alongside projects which use CI and it’s the right time to do this before everyone moves away from CodedUI just like they did with VS Test.