Questions on the filter query language #3781
Replies: 2 comments 3 replies
-
How do you plan to use the filter, would there be more syntaxes in use? (personally) I struggle when using the new syntax interactively. Like when I want to filter to tests that are in one class, I cannot just say I think it is great for programatically communicating the exact test you want to run though. |
Beta Was this translation helpful? Give feedback.
-
I need to check back my notes and the implementation for most of your questions. I'll post back when I have the details (there might be some delay with hackathon going next week).
As of today, we are limited by VS that forces us to have this assembly/namespace/type/method structure but we have tried to design the platform as agnostic of the current limitations. All test nodes can be composed as any arbitratry graph and this filter is meant to work as graph filter where To be talking less absract, if we take the example of F# Expecto, you can define tests like testList "A test group" [
testList "A sub group" [
test "one test" {
Expect.equal (2+2) 4 "2+2"
}
]
test "another test" {
Expect.equal (2+2) 4 "2+2"
}
] You will have 2 tests:
|
Beta Was this translation helpful? Give feedback.
-
Regarding https://github.com/microsoft/testfx/blob/main/docs/mstest-runner-graphqueryfiltering/graph-query-filtering.md I have a few questions, as I'm considering using the same language in xUnit.net.
Your examples seem to imply (but don't declare) a not (
!
) operator (in the example/A/(B*)&(!*C)
). Presumably this can be added to the front of any filter to invert the result, but if present anywhere else is treated as literal text, correct?Your examples with wildcards all use either
A*
,*A
, or*A*
. I never see any examples of wildcards in the middle of text (i.e.,AB*CD
). Is that supported?Is the parenthesis allowed to span nodes and/or node+properties? For example, are these legal:
a.
(/A1/B1/**)|(/A2/B2/**)
b.
/*/*/*/(D1[Prop1=Value1])|(D2[Prop2=Value2])
If they're not, then can you apply multiple filters via
--filter
? If so, I presume those filters are treated implicitly as an OR operation (i.e.,--filter expr1 --filter expr2
would be logically equivalent to--filter (expr1|expr2)
even though the latter may not be syntactically legal, correct?I assume your "real life examples" mean that you are, in fact, mapping
/A/B/C/D
to assembly A, namespace B, type C, and method D, right? This isn't an example so much as a definition of the implementation?Are any properties coming from anywhere that's not user generated? (In the case of xUnit.net, that would be traits.) Or another way to say this is: are there any implicit properties that are always available? Your example of
[OS=Linux]
made me wonder if you planned to pre-populate some properties that could be queried above and beyond any user-provided metadata.All the examples show a single OR (
|
) or AND (&
). Is it legal to chain more than one (i.e.,[(p1=v1)|(p1=v2)|(p2=v3)]
? If it's legal to chain more than one, can you mix OR and AND together, and if so what are the precedence rules? (Perhaps an implied part of this second half question is whether nested parentheses are legal.)Beta Was this translation helpful? Give feedback.
All reactions