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
5
votes
2 answers

Dotnet test on .NET Core 1.1 in VSTS: No Test Discoverer is Registered

I'm using VS 2017 with the new csproj in a .NET Standard class library, trying to test the library with a .NET Core 1.1 test project using MSTest testing framework with the dotnet test command. Running locally works perfectly fine; when I send the…
Dagrooms
  • 1,507
  • 2
  • 16
  • 42
5
votes
0 answers

How to remove standard output from vstest.console test run?

When I run the below code in the Developer Command Prompt for Visual Studio: vstest.console.exe UnitTestAssemblyName.dll I receive the following: Passed Test_1 Text Text Text (...) Passed Test_2 Where "Text" is logged as a result of Test_2…
5
votes
3 answers

How to stop test if one test fails using vstest.console.exe?

I have a batch file that contains multiple tests defined in a similar form below. vstest.console.exe Test.dll /Settings:"test.runsettings" /Tests:"t1,t2,t3,t4,t5" The tests run in order from t1 to t5. However, I want to stop vstest if any one of…
Bangonkali
  • 1,111
  • 9
  • 13
5
votes
0 answers

vstest.console.exe generating empty .trx file even after executing the Test Cases from the team city build agent

After executing the test cases successfully through the team city vstest.console.exe runner, the test result file that is being generated doesn't contain any test summary. The team city logs are as follows:- Total tests: 69. Passed: 50. Failed: 19.…
5
votes
2 answers

Running xUnit tests with vstest

I am trying to run my xUnit unit tests using vstest.console.exe, but no tests are found. I am using vstest.console.exe from Visual Studio 2015, found in this location: C:\Program Files (x86)\Microsoft Visual Studio …
Dave New
  • 38,496
  • 59
  • 215
  • 394
5
votes
1 answer

vstest.console.exe not generating trx file, TestResults empty

I am trying to run below command on my build server, c:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "C:\UnitTest\MyTests.dll" /settings:"C:\UnitTest\output.runsettings" …
rajcool111
  • 657
  • 4
  • 14
  • 36
4
votes
0 answers

NUnit3 test adapter warnings on azure pipeline

recently without any direct changes to tests solution this error started occurring during execution of VSTEST@2 task on my azure pipeline. ##[warning]DiscoveryMessage : Failed to load extensions from file 'D:\a\1\s\src\...\NUnit3.TestAdapter.dll'.…
cyman1998
  • 73
  • 1
  • 7
4
votes
3 answers

VSTest.Console.exe Could not load file or assembly Microsoft.TestPlatform.CoreUtilities

I'm trying to set up a C# project with the latest version of Visual Studio, 2022; this is with .Net 6 on Windows 10. It's a simple console program, and I've set up the project and a corresponding unit test project basically following the steps…
rwallace
  • 31,405
  • 40
  • 123
  • 242
4
votes
0 answers

dotnet test Runsettings arguments to exclude unit tests from code coverage

So I was able to supply runsettings and that worked dotnet test --filter "TestCategory != Ignore" --no-build --no-restore -v normal --collect "Code coverage" -s *.runsettingss Which included this:
Ofek
  • 325
  • 1
  • 2
  • 13
4
votes
0 answers

Is it possible to run tests programmatically on assembly in memory?

Scenario Dot net mutation tool that makes a mutation, runs tests, gathers results, and repeat like 2000 times. Mutations happen in memory, writing the mutated assembly to a disk for every mutation is very slow (at HDD's at least). The ideal world…
Timon Post
  • 2,779
  • 1
  • 17
  • 32
4
votes
1 answer

NUnit tests are not restarted through VSTest in DevOps

I am using VSTest to run tests via Azure DevOps. Tests run successfully, but using the option rerun failed tests: true, an error appears during the restart phase. NUnit 3.12.0 ; NUnit Adapter 3.16.1.0 (Checked with 4.0.0.0) vstest.console.exe…
4
votes
3 answers

Why does dotnet vstest return "No test is available in" when the test works in vstest.console.exe?

I have a built dll file for a test project in .net framework 4.6. The test runs fine when I do vstest.console.exe test.dll but when I do dotnet vstest test.dll it says No test is available in test.dll. Make sure that test discoverer & executors…
agentq15
  • 105
  • 2
  • 5
4
votes
1 answer

Publishing test results from Azure CLI job

I am using Azure CLI task type in my build pipeline to run tests. I am using this task type to resolve a problem when tests cannot access Azure Key Vault (see this answer: https://stackoverflow.com/a/56863107/1600629) I have this inline…
Taras
  • 205
  • 3
  • 8
4
votes
2 answers

Pass argument or option to Unit Tests from VSTest.Console.exe

I can successfully run the VS unit tests from the command line (and hence from the build on the build machine). VSTest.Console.EXE "MyTest.dll" /logger:trx /platform:x64 /inIsolation I can also filter out any required tests that I don't want to…
Ajay
  • 18,086
  • 12
  • 59
  • 105
4
votes
2 answers

How to run unit tests with .NET version 4.6.2 in Visual Studio 2019?

I'm trying to resolve this warning from unit test runs in Visual Studio: [6/7/2019 7:16:21 PM Warning] Test run will use DLL(s) built for framework .NETFramework,Version=v4.5 and platform X64. Following DLL(s) do not match framework/platform…