Questions tagged [vstest]

Visual Studio Test (VSTest.Console.exe) is a test runner developed by Microsoft.

Visual Studio Test (VSTest.Console.exe) is a test runner developed by Microsoft.

It can run automated unit and coded UI tests from a command line, and is used in place of MSTest.exe beginning with Visual Studio 2012.

unit tests are natively supported, but it can also run other 3rd party unit test frameworks (eg. , etc) when configured either as an installed extension or via the /TestAdapterPath path.

See VSTest.Console.exe command-line options for more information.

368 questions
175
votes
9 answers

How can I run NUnit tests in Visual Studio 2017?

I've just installed Visual Studio 2017. I have a project using NUnit for the test cases. Ctrl + R - T no longer runs the tests, and the Test Explorer no longer finds any test cases marked with the TestCase attribute. Is there a way to get NUnit…
user2286552
66
votes
4 answers

Specifying results filename for vstest.console.exe

May be a silly question, but does anybody know how to specify the output filename of a VSTEST.Console.exe run? My command line is as follows: vstest.console.exe [assembly] /logger:trx At the end of the run, the following comes up in the console: …
syazdani
  • 4,760
  • 1
  • 26
  • 35
46
votes
9 answers

TFS Tests do not match framework settings

I am attempting to move a solution from TFS 2012 to TFS 2018 SP2RC2 but I can't get the unit tests to run correctly. All projects have been re-targeted to 4.7.1 and are built as x86 platform. We have a testsettings file that supplies nothing but…
Sam
  • 1,325
  • 1
  • 13
  • 26
24
votes
2 answers

When running `dotnet test` show output of the `dotnet vstest` output sink

Edit: Below is the former question originally posted with the title xunit show ITestOutputHelper output when run in the console After investigation (see comments), the question is still very much relevant and in need of an answer but it seems…
George Mauer
  • 117,483
  • 131
  • 382
  • 612
16
votes
0 answers

vstest.console.exe execution model and isolation behaviors

I'm trying to determine the considerations that should be made when writing tests that are going to run under vstest.console.exe. Example 1: Let's say that I have two tests both of which rely on MyClass.Singleton.Counter having a value of zero. Now…
Kaleb Pederson
  • 45,767
  • 19
  • 102
  • 147
16
votes
2 answers

No xunit tests discovered by vstest.console.exe

I'm putting together a new stack of unit tests to be run together as a CI job. I'm using vstest.console.exe instead of mstest.exe mainly for its ability to run tests from several frameworks, but right now the focus is a few xUnit dlls. The jobs are…
eddie.sholl
  • 740
  • 1
  • 6
  • 18
15
votes
2 answers

VSTest: A testsettings file or a runsettings with a ForcedLegacyMode set to true is not supported with the MSTest V2 Adapter. No test is available

How to use .testsettings file running unit tests via vstest.console.exe? I created empty visual studio solution, created empty unit test project, added Local.testsettings file as a solution item. [TestClass] public class UnitTest1 { …
Joseph Katzman
  • 1,959
  • 6
  • 21
  • 47
13
votes
1 answer

How to stop MsTest tests execution on first failure?

We are running nightly builds which at the end run all of our UnitTest using the MsTest framework. We must have 100% pass rate, so if one fails there is no point running the others; hence we will like to stop the execution on the first failed…
Alon1980
  • 1,225
  • 1
  • 16
  • 30
12
votes
1 answer

Visual Studio 2013 - Cleanly disabling VSTEST Discovery Engine?

Quick question about VS2013 settings - is there a way to disable the VSTEST Discovery engine from starting on/after build? I've never had this process running as a child-process of VS2013 before, however I recently created a unit-test project in…
OBR_EXO
  • 600
  • 4
  • 19
11
votes
1 answer

How to enable the code coverage view on VSTS?

My team uses VSTS with hosted agents and a Visual Studio Test build task to run all tests and produce code coverage. However the tab Code coverage remains empty afterwards, only showing a link to download the *.coverage file. I actually expect the…
Herman Cordes
  • 4,628
  • 9
  • 51
  • 87
11
votes
2 answers

VSTests - Could not find diagnostic data adapter 'Code Coverage'

I'm new to VS Code Coverage, and I'm trying to use the VSTests tool from the command line (in windows). But i get this error. Warning: Diagnostic data adapter message: Could not find diagnostic data adapter 'Code Coverage'. Make sure diagnostic…
Mr. Blo
  • 111
  • 1
  • 4
11
votes
2 answers

SonarQube Test Coverage with MsTest

I have been trying to get SonarQube working with a simple dot net app. I have had some success getting it up and running but code coverage is not working. It looks like many other people have faced this issue when SonarQube discontinued support for…
user3210699
  • 197
  • 1
  • 2
  • 8
11
votes
1 answer

Unable to run WP81 unit tests with VSTest.Console.exe

I am trying to run Windows Phone 8.1 unit tests from the command line using the vstest.console.exe. I have created a new Windows Phone 8.1 unit test project in VS 2013 (Update 4): The unit test is discovered in Visual Studio and I am able to run it…
Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
10
votes
1 answer

How to define multiple matching patterns in AzureDevOps Pipeline VSTest@2?

Currently I'm trying to set up a new pipeline for our solution and can't get the Visual Studio Test to find the correct set of tests within my solution. Either it picks a DLL that doesn't contain any tests (which leads to a fail of the task) or if I…
Oliver
  • 43,366
  • 8
  • 94
  • 151
10
votes
2 answers

Set "Path" environment variable during vsts build so it would persist across build tasks specifically vsTest task

I have a vsts build definition in which I try to set the PATH environment variable using PowerShell (and before I tried cmd) task, so that in a later vsTest task, the tests could run an exe from that path, however setting the PATH using the ps\cmd…
1
2 3
24 25