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

libtest: add a --skip flag to the test runner #36604

Merged
merged 2 commits into from
Sep 28, 2016

Conversation

japaric
Copy link
Member

@japaric japaric commented Sep 20, 2016

This flag takes a FILTER argument and instructs the test runner to skip
the tests whose names contain the word FILTER. --skip can be used
several times.


My motivation for submitting this is that while using smoke to run std unit tests for cross
targets I found that a few of the tests always fail due to limitations in QEMU (it can't handle too
many threads) and I'd like to skip these problematic tests from the command line to be able to run
the rest of the unit tests.

I know there is another mechanism to skip tests: #[ignore] but this doesn't work in my use case
because I can't (easily) modify the source of the standard libraries to #[ignore] some tests. And
even if I could, the change would involve conditionally ignoring some tests for some targets but
that's not a perfect solution because those tests should pass if executed on real hardware so they
should not be #[ignored] in that scenario.

r? @alexcrichton
cc @brson

This flag takes a FILTER argument and instructs the test runner to skip
the tests whose names contain the word FILTER. --skip can be used
several times.
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@alexcrichton
Copy link
Member

Looks good to me! Perhaps a test could be added as well?

cc @rust-lang/tools thoughts on semantics, naming, and/or just the feature itself?

@michaelwoerister
Copy link
Member

LGTM!

@brson
Copy link
Contributor

brson commented Sep 27, 2016

sgtm. I have other cases where this would be useful, similar to japaric's: someday we'll have std factored so that it can be implemented out of tree, and with its test suite in another crate, and those out-of-tree consumers would need a way to ignore tests for their platforms.

@brson brson added the relnotes Marks issues that should be documented in the release notes of the next release. label Sep 27, 2016
@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Sep 27, 2016

📌 Commit adf85d3 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Sep 28, 2016

⌛ Testing commit adf85d3 with merge 4eab0e4...

@bors
Copy link
Contributor

bors commented Sep 28, 2016

💔 Test failed - auto-win-gnu-32-opt-rustbuild

@japaric
Copy link
Member Author

japaric commented Sep 28, 2016

@bors r=alexcrichton

@bors
Copy link
Contributor

bors commented Sep 28, 2016

📌 Commit 45916ec has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Sep 28, 2016

⌛ Testing commit 45916ec with merge d75c84a...

bors added a commit that referenced this pull request Sep 28, 2016
libtest: add a --skip flag to the test runner

This flag takes a FILTER argument and instructs the test runner to skip
the tests whose names contain the word FILTER. --skip can be used
several times.

---

My motivation for submitting this is that while using [smoke] to run `std` unit tests for cross
targets I found that a few of the tests always fail due to limitations in QEMU (it can't handle too
many threads) and I'd like to skip these problematic tests from the command line to be able to run
the rest of the unit tests.

[smoke]: https://github.com/japaric/smoke

I know there is another mechanism to skip tests: `#[ignore]` but this doesn't work in my use case
because I can't (easily) modify the source of the standard libraries to `#[ignore]` some tests. And
even if I could, the change would involve conditionally ignoring some tests for some targets but
that's not a perfect solution because those tests should pass if executed on real hardware so they
should not be `#[ignored]` in that scenario.

r? @alexcrichton
cc @brson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants