Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign uplibtest: add glob support to test name filters #46417
Conversation
rust-highfive
assigned
bluss
Dec 1, 2017
This comment has been minimized.
This comment has been minimized.
|
r? @bluss (rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
|
One question that should probably be resolved: currently, globbing is enabled either if
With the tests All this taken together, I suggest we keep things the way they are currently (only infer from main pattern or presence of |
jonhoo
force-pushed the
jonhoo:glob-test-pattern
branch
from
432a38b
to
6775588
Dec 1, 2017
jonhoo
force-pushed the
jonhoo:glob-test-pattern
branch
from
6775588
to
9813b49
Dec 1, 2017
This comment has been minimized.
This comment has been minimized.
|
I changed my mind. Latest commit interprets patterns independently, so the example given before
will now work correctly (it'll include |
kennytm
added
the
S-waiting-on-review
label
Dec 1, 2017
jonhoo
force-pushed the
jonhoo:glob-test-pattern
branch
2 times, most recently
from
17c28f6
to
0a122f0
Dec 1, 2017
jonhoo
force-pushed the
jonhoo:glob-test-pattern
branch
from
0a122f0
to
0b83c56
Dec 1, 2017
This comment has been minimized.
This comment has been minimized.
|
This PR should probably also be tagged with |
jonhoo
referenced this pull request
Dec 1, 2017
Open
Test name filtering does not allow disambiguating tests with overlapping names #46408
This comment has been minimized.
This comment has been minimized.
|
Surprisingly tricky to figure out who the right person for review on |
rust-highfive
assigned
Mark-Simulacrum
and unassigned
bluss
Dec 1, 2017
Mark-Simulacrum
added
the
relnotes
label
Dec 1, 2017
This comment has been minimized.
This comment has been minimized.
|
Code looks good in general. However, I'm not sure why we need the Could you explain that? In terms of review, it seems like we may want to make this unstable, but I don't know if that's possible for libtest parameters. If we can't make it unstable then we should get all of libs team to sign off on it at least. |
This comment has been minimized.
This comment has been minimized.
|
Good point -- I removed the flag. Technically the flag changes the behaviour of strings that do not contain the special characters, since globs required a complete match. Non-glob matches are substring matches by default. But I think you're right that in practice the I don't know of a way to make libtest parameters unstable, except by manually adding |
This comment has been minimized.
This comment has been minimized.
|
@rust-lang/libs thoughts? This seems good but I'd want sign off from everyone since it'll probably be insta-stable. |
This comment has been minimized.
This comment has been minimized.
|
This seems like a fine idea in principle. I think my only concern here would be the stabilization of the glob syntax itself. Aside from the fact that the glob crate isn't extern crate glob;
use glob::Pattern;
fn main() {
let pat = Pattern::new("{*").unwrap();
println!("{:?}", pat.matches("{foo"));
let pat = Pattern::new("{foo}").unwrap();
println!("{:?}", pat.matches("{foo}"));
}Would we consider this an acceptable breaking change? If so, then I suppose it seems fine to move forward. (In the sense that I can't think of any other concerns with the public facing interface.) |
jonhoo
force-pushed the
jonhoo:glob-test-pattern
branch
from
2871364
to
2482c58
Dec 2, 2017
This comment has been minimized.
This comment has been minimized.
|
@BurntSushi I'm not too concerned about that for the same reason I'm not concerned about introducing automatic interpretation of strings as globs in general: test names cannot contain |
This comment has been minimized.
This comment has been minimized.
|
Historically the test crate actually had support for full-blown regexes and that was just removed in the lead-up to 1.0 where we moved the regex crate to crates.io instead of in the standard library/libextra. In that sense there's definitely desire for this! That being said I'm wary of using the So I guess tl;dr; I'd ideally prefer for the extra support we add here to be specifyable (aka have documentation and be supported) which I think rules out |
This comment has been minimized.
This comment has been minimized.
|
I'd love having full regex support (similar to Custom test runners would be nice, I agree, but as you say we have been wanting that for a long time, and it doesn't seem like much is changing any time soon. It's also nice for the default thing that is run with I think |
This comment has been minimized.
This comment has been minimized.
|
Gentle ping @alexcrichton |
This comment has been minimized.
This comment has been minimized.
|
Ah sorry about that. I definitely understand where you're coming from but for me maintainability of a crate like libtest trumps almost all else, so the fact that |
This comment has been minimized.
This comment has been minimized.
|
Hmm, that's unfortunate, but I understand the reasoning. Is there any particular place to monitor the progress of custom test runners, and potentially to contribute/discuss directions going forward? |
This comment has been minimized.
This comment has been minimized.
|
For posterity, the conversation here was resumed on IRC |
This comment has been minimized.
This comment has been minimized.
|
Also relevant: https://internals.rust-lang.org/t/past-present-and-future-for-rust-testing/6354/18 Putting this in the libs team's court for triage purposes :) |
carols10cents
added
S-waiting-on-team
T-libs
and removed
S-waiting-on-review
labels
Dec 12, 2017
This comment has been minimized.
This comment has been minimized.
|
@carols10cents hehe, yes, that was the follow-up to the IRC follow-up. @steveklabnik mentioned that he wanted to bring it up during the work week, so hopefully we'll see some further discussion coming out of that. |
This comment has been minimized.
This comment has been minimized.
|
Ok I'm going to close this for no in favor of @jonhoo's thread on internals |
jonhoo commentedDec 1, 2017
•
edited
Tests can currently only be filtered by substring or exact match. This makes it difficult to have finer-grained control over which tests to run (#46408), such as running only tests with a given suffix in a module, all tests without a given suffix, etc.
This PR adds support for glob patterns in test name filters. When at least one of the special glob characters (
*,?, or[) are present, the pattern is interpreted as a glob, and used to match against test names. These characters cannot appear in ordinary test names, so this should not cause unexpected results. This allows commands such as:or
Fixes #46408.