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
6
votes
1 answer

xUnit tests run locally but not on Azure DevOps

I have xUnit tests which run fine locally but do not get run on Azure DevOps. The assembly under test is a .NET 5.0 assembly as is the test assembly. Examining the log file from the VsTest task, I see the following Test run detected DLL(s) which…
Tim
  • 1,621
  • 4
  • 19
  • 35
6
votes
2 answers

Not Contains TestCase filter not working in VSTest 16.6.1

According to the official TestCase documentation, you can use a "not contains" (!~) filter in a TestCase filter. I'm trying to use this filter in an Azure Devops pipeline, but the filter is not supported according to the error I get when running…
Joshua VdM
  • 628
  • 5
  • 16
6
votes
2 answers

UnitTestIsolationException : Failed to resolve profiler path from COR_PROFILER_PATH and COR_PROFILER environment variables

I am using VS2015 with Update 3. I have a simple hello world unit test project where I am trying to get the shimContext , below is the code snippet. I am getting the exception at shimContext to create call:…
Somu
  • 515
  • 1
  • 5
  • 12
6
votes
1 answer

VSTest task does not execute test dll(s) built for Platform x64

I am using Visual Studio Test task version 2 in my build definition in TFS 2017. Once my build is successful and it generates test dll(s),VSTest task is not able to run the test dll(s) that are built on platform x64.I am getting the following…
6
votes
1 answer

How to pass secrets into the test execution context from VSTS

Values that need to be passed into the test execution context of a test typically get passed via "variables" in VSTS. These typically show up as environment variables. These values may need to be kept secret (client secret from a service principal,…
JordanBean
  • 1,949
  • 21
  • 28
6
votes
2 answers

Calling Assert.Inconclusive() in an async unit test is reported as a fail

I have a series of unit tests that connect to an Azure Storage emulator. In Setup my code checks if there is something listening on the emulator's port, and if not sets a flag StorageNotAvailable. In each of my tests I have some code... if (…
Richard Hauer
  • 1,298
  • 9
  • 22
6
votes
4 answers

VStest code coverage report in jenkins

I am setting CI for .Net project using Jenkins. I used MSTest Plugin and VStestrunner plugin to run test. Now I have .trx file and .Coverage file I am facing problem in displaying code coverage report Please help me is you know any plugin to do…
5
votes
1 answer

How to ignore some files when generating test coverage with VSTest and reportgenerator tools on Azure pipelines

I have a problem that I have failed to resolve. I have a .NET core project that I want to run tests and publish the test coverage on Azure Pipelines. The problem is: I'm using EF to generate Migrations files. I want to ignore these files from…
Quyết
  • 502
  • 5
  • 12
5
votes
1 answer

How to only run previously failed tests with dotnet vstest

I have a test suite of over 10,000 tests and sometimes only want to rerun the tests, that failed on the previous run, using the dotnet vstest CLI.
lauxjpn
  • 4,749
  • 1
  • 20
  • 40
5
votes
2 answers

Difference between vstest.console.exe and dotnet test commands

Is there any difference between vstest.console.exe and dotnet test commands to run unit test from a terminal? Like when should you use one over the other. Is "vstest.console.exe" meant for only .Net framework and "dotnet test" for dotnet core…
cmoe
  • 141
  • 3
  • 12
5
votes
0 answers

Azure Pipelines - Visual Studio Test does not publish results from TestContext.WriteLine

We are using Azure DevOps to run a build that runs tests using Visual Studio Test. Everything is working fine, Console.WriteLine lines are being written to Standard Console Output.log, however TestContext.WriteLine are not appearing in the Detailed…
elgato
  • 506
  • 1
  • 5
  • 20
5
votes
1 answer

VSTest-Task not running .NET Core 2.1 xUnit-Tests from Test-plan

I'm trying to create a release pipeline in VSTS that runs my xUnit-tests as specified in a Test Plan. Long story short: I can't get it to work. What I'm using: Azure DevOps (formerly VSTS) Visual Studio Test task (v2.*) Test project targeting .NET…
5
votes
4 answers

VSTS "Visual Studio Test" task can't find tests of .Net Core dlls

My VSTS - "Visual Studio Test" task can't find any tests of the .NET Core assembly. But in VS 2017 and in the console, it works well. VSTS Task's logs: My run settings file:
Fanny
  • 111
  • 2
  • 7
5
votes
1 answer

Why does TFS agent doesn't discover a VSTEST capability

We have TFS 2015 server and also a build server with Visual Studio 2017 Ultimate. TFS agent is not able to detect VisualStudio or VsTest capabilities (as it should) but when added manually, there is still a problem. When it comes to Visual Studio …
lekso
  • 1,731
  • 3
  • 24
  • 46
5
votes
0 answers

How to include test category in visual studio test results

How do I make sure the test categories I used in my unit tests are included in the test results. So that I could use the category to filter my tests or generate a html using trx2html grouped by the category. [Trait("Category", "1")] public class…
Sunil Buddala
  • 1,123
  • 1
  • 10
  • 22
1 2
3
24 25