-
Notifications
You must be signed in to change notification settings - Fork 20
Support permanently skipping tests on a specific system #331
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
Comments
That seems to be a lot of effort for a single test. |
The actual code change to support this is one line in
is a good reminder that you've got some tests not running on your system that you're relying on CI for. |
Maybe we need additional capabilities in test return values? We can already return |
Yeah, that was the alternative I put in which I think is the better solution for this particular example. I still feel that the ability to skip tests via an env-var is useful in other situations, is far easier to get stabilized, and is easier to work with while unstable (since it's local config, not a feature that needs to be added to the test code). |
I do think an environment variable is reasonable anyway -- there's precedent in other test options like |
Citing |
I think we should hand this over to the folks currently working on improving libtest and the test infrastructure. Cc @rust-lang/testing-devex. FWIW, I think we should have some way of marking a test as explicitly "unsupported" or similar, in a fashion that gets counted and listed as such by |
This is a very understandable problem. We have helpers in Cargo to deal with this and I dislike how limited those helpers are within cargo and the fact that they are limited to cargo. Frustrated with that experience, I originally approached T-libs-api with proposed extensions to libtest to solve that and other problems and the tentative decision we came up with is to feature-freeze libtest and focus on first-class custom test harness support where these things could be more naturally exposed. You can find my notes on this at my blog. T-testing-devex is working incrementally and has not officially adopted that full plan yet. Yes, my blog post was from a while ago. I had to finish up other priorities before rolling over to this work. I had hoped we could recruit others to help in the mean time but it didn't work out. It is now my primary focus (when not distracted...). If someone would want to help with that effort, it'd be much appreciated! |
@epage I definitely think an environment variable is not the path I'd want to go here. I'd be much more interested in something like a magic type that you can panic with to indicate "not supported" (and then a macro that panics with that type), and some kind of attribute annotation that says "skip this but leave a stub that panics with that type" (or with a similar type if we want to distinguish the two). I agree that this would need to wait on a custom test harness. |
Proposal
Problem statement
Sometimes it is not possible to run a specific test on a system because of environmental reasons. These can be skipped by using
cargo test -- --skip some_test_name
, but this must be specified every time tests are run.Motivating examples or use cases
cargo
has a testcargo_metadata_non_utf8
that tests it can be used while in a non-utf8 directory. That test is alreadycfg
gated because:But even this claim of working on linux is specific to some linux filesystems, attempting to run this test when the target-dir is on zfs with
utf8only=on
fails:This is a fundamental system restriction which means this test will never work here and should always be skipped.
Solution sketch
Extend
libtest
's--skip
CLI arg with aRUST_TEST_SKIP
environment variable, a comma separated list of filters that will be added on to those parsed from the args, allowing it to be permanently set in the working tree via utilities likedirenv
.Alternatives
Extend
libtest
's in-process API to allow this test to mark itself as unsupported when it gets this error code while setting up. I believe this would be a good solution to additionally have, and more useful in this specific case, but I think both have their uses and adding the environment variable is easier to get done first.Links and related work
rust-lang/rust@master...Nemo157:rust:rust-test-skip-env-var
What happens now?
This issue contains an API change proposal (or ACP) and is part of the libs-api team feature lifecycle. Once this issue is filed, the libs-api team will review open proposals as capability becomes available. Current response times do not have a clear estimate, but may be up to several months.
Possible responses
The libs team may respond in various different ways. First, the team will consider the problem (this doesn't require any concrete solution or alternatives to have been proposed):
Second, if there's a concrete solution:
The text was updated successfully, but these errors were encountered: