Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "!~" operator to test filter #1794

Closed
livarcocc opened this issue Oct 10, 2018 · 5 comments
Closed

Add "!~" operator to test filter #1794

livarcocc opened this issue Oct 10, 2018 · 5 comments

Comments

@livarcocc
Copy link

From @mano-cz on October 10, 2018 8:12

Steps to reproduce

run "dotnet test Some.csproj --filter FullyQualifiedName!~Some.Namespace"

Expected behavior

Not contain operator will work.

Actual behavior

Not contain operator is not implemented yet.

Use case

Parallelization of test execution according to namespaces e.g.:
#1 thread - filter on few namespaces
#2 thread - filter on other few namespaces
#3 thread - filter on remaining (dynamic) namespaces (with usage of !~ operator on namespaces from previewous threads)

Copied from original issue: dotnet/cli#10149

@mayankbansal018
Copy link
Contributor

mayankbansal018 commented Oct 16, 2018

@mano-cz, we don't support similar to(~) operator, with not(!), however we support similar(~). For more queries related to filters please go through https://github.com/Microsoft/vstest-docs/blob/master/docs/filter.md

However if you exact ask is !~, that would be an enhancement on our part

@hgran
Copy link
Contributor

hgran commented Oct 18, 2018

I’d like to have a go at this if that’s ok?

@hgran
Copy link
Contributor

hgran commented Oct 19, 2018

Issue #1385 describes the same functionality.

@baruchiro
Copy link

How can I know if my dotnet vstest supports this?

$: dotnet vstest

--TestCaseFilter|/TestCaseFilter:<Expression>
      Run tests that match the given expression.
      <Expression> is of the format <property>Operator<value>[|&<Expression>]
         where Operator is one of =, != or ~  (Operator ~ has 'contains'
         semantics and is applicable for string properties like DisplayName).
         Parenthesis () can be used to group sub-expressions.
      Examples: /TestCaseFilter:"Priority=1"
                /TestCaseFilter:"(FullyQualifiedName~Nightly
                                  |Name=MyTestMethod)"

And how can I get this change?

@baruchiro
Copy link

Sorry, my problem was unupgraded Microsoft.sdk.Test nuget.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants