Run / exclude specific tests in the Team Foundation Server 2015 assembly definition

In one of our build definitions, I'm trying to configure the Visual Studio Test build step to run a specific set of tests.

There is a test filter criteria field (see below), but this does not seem to have any effect, regardless of all tests. This is not like the search filter field in Test Explorer in VS2015, and there are some links to “TestCaseFilter”, but this is not applicable here (and maybe only TFS2012).

Defining TFS Configuration Visual Studio Test Configuration

Can this be used to actually filter the tests, or should I do it differently (for example, provide a settings file?)

FWIW we use Xunit for our unit tests.

+5
source share
3 answers

test filter criteria filters tests from test assembly files. This option works the same as the /TestCaseFilter of vstest.console.exe console option, you can check the vstest.console.exe command line to see if it works.

Alternatively, you can specify the tests in the Test Assembly . This field indicates the test assembly (s) from which to select tests.

  • Wildcards can be used
  • You can specify multiple paths separated by semicolons
  • Paths refer to the source directory.
+1
source

The test filter criteria field is the best way to filter tests. You need to add an attribute to your tests in order to classify your tests. Here is a post explaining this feature:

https://dotnetcatch.com/2016/03/11/vststfs-visual-studio-test-task-filter-criteria/

+2
source

If the goal is to exclude the test test from the run, which can be done with

TestCategory!={name}

In my case, I usually use Integration or Manual to specify a non-CI test, so my filter

TestCategory!=Integration&TestCategory!=Manual

0
source

Source: https://habr.com/ru/post/1247718/


All Articles