-
-
Notifications
You must be signed in to change notification settings - Fork 95
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 expression based test filtering #117
Conversation
b5454bf
to
0bdbec9
Compare
Your general design looks great. Let's do:
Note that this performs the intersection of the two sets, which using the Some other questions:
What do you think? |
You are right, I meant all the tests in package
"Sorting tests by key" you meant filtering on test names ? I guess I can keep it for the end, but as it might be useful for me I'm inclined to do it. I probably won't have much time in the days to come, so this will be somehow slow to come. |
I mean sorting the order in which tests are run. |
b17170d
to
1e1c849
Compare
615ea42
to
2903640
Compare
I worked on a first draft of DSL definition and parsing, if you want to see where I'm going. Nothing finished yet, but I have a first version of a full parsing. |
2903640
to
f7e0b0e
Compare
I finally changed a bit the syntax:
This makes it easier to parse and (I think) easier to use. The current limitations are:
In both cases, this should not matter as they are both characters that can not be part of a test or package name. |
05e5b67
to
038bef0
Compare
I have a first draft of filtering.
Still todo:
As of now, I have issues implementing I opened an issue for this facebookarchive/cargo-guppy#632 |
So it looks like I need to find out why my test of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great -- I'm really excited about how this is progressing!
737d5e7
to
e8b1994
Compare
I'm done with my compilation optimization passes, if you want to have another look. |
Thank you—I have other stuff coming up within the next couple of days but will try and take a look soon. |
fd6566c
to
c41267d
Compare
Here we go, I:
At this point all is working, and I'm ready for reviews and critics ! |
57065ac
to
ebd7e9f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! It might take a little while for me to get through this, have some errands today and medical things for the rest of the week. The other maintainer is busy as well :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking fantastic! Just a couple more changes and I'm happy to finish up the rest and get this out there!
- `all()`: include everything | ||
- `test(name-matcher)`: include all tests matching `name-matcher` | ||
- `package(name-matcher)`: include all tests in packages matching `name-matcher` | ||
- `deps(name-matcher)`: include all tests in packages depended by packages matching `name-matcher` and include all tests in packages matching `name-matcher` | ||
- `rdeps(name-matcher)`: include all tests in packages depending on packages matching `name-matcher` and include all tests in packages matching `name-matcher` | ||
- `none()`: include nothing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a partition
operator as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like --partition
? this might be a little bit more complex and requires state.
Can we do it after, in an other PR ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah absolutely! I figured it would require some state, yeah. We also need to figure out the behavior with the --partition
flag (I suspect we want to disallow use of both the partition()
operator and the --partition
flag, and maybe deprecate the --partition
flag).
b8e1c85
to
a1611e9
Compare
using miette create nice parsing error
a1611e9
to
2db5df6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great -- just a couple more changes, and I'm happy to land this and finish it up myself if you like.
- can contains escaped closing parenthesis: `\)` | ||
- can contains unicode sequence: `\u{xxx}` (where `xxx` is an 1 to 6 digits hexadecimal number) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also \r
, \n
etc, right?
|
||
Precedences from lowest to highest: | ||
- `not`, `()` | ||
- `&`, `|`, `-` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does an expression with &
and |
get resolved? In general I'd expect us to follow a similar pattern to https://doc.rust-lang.org/reference/expressions.html#expression-precedence -- from highest to lowest:
()
!
,not
&
,and
|
,+
,or
Only real difference is that +
is grouped with |
.
Going to land this and clean it up, thanks again for all your incredible efforts here. |
As you are up apparently, I push this to open the discussion.
Following what you said, I was thinking maybe something along the line of:
DSL
package(name)
deps(package_name)
rdeps(package_name)
test(partial_name)
not(expr)
expr && expr
/expr and expr
expr || expr
/expr or expr
(expr)
Like
-E "package(driver) or test(use_driver_)"
,-E "package(utility_package) and rdeps(utility_package)"