Notification texts go here Contact Us Buy Now!

Yaml: How to exclude some tests in VSTest@2

To exclude specific tests using VSTest@2, you can leverage the testAssemblyVer2 input property in conjunction with the | notation to define multiple patterns.

- task: VSTest@2 inputs: testSelector: 'testAssemblies' # note the | testAssemblyVer2: | **\*_uTest.exe !**\*BBE*

In this example:

  • **\*_uTest.exe: This pattern matches all files ending with _uTest.exe in any folder.
  • !**\*BBE*: This pattern excludes any file or folder containing BBE in its name.

The | notation is crucial here as it allows you to specify multiple patterns on different lines. Without it, all lines would be treated as a single input, resulting in incorrect behavior.

Alternatively, you can use the testFiltercriteria input property to exclude specific tests based on their fully qualified name:

- task: VSTest@2 inputs: testSelector: 'testAssemblies' testAssemblyVer2: | **\*_AlluTests.dll testFiltercriteria: 'FullyQualifiedName!~TestCase1&FullyQualifiedName!~TestCase2'

Here, the testFiltercriteria is set to FullyQualifiedName!~TestCase1&FullyQualifiedName!~TestCase2, which excludes tests with the fully qualified names TestCase1 and TestCase2.

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.