-
Notifications
You must be signed in to change notification settings - Fork 13.3k
fix(test): Expose '--no-capture' in favor of --nocapture
#139224
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
Conversation
let mut opts = optgroups(); | ||
// Flags hidden from `usage` | ||
opts.optflag("", "nocapture", "Deprecated, use `--no-capture`"); |
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.
From PR description:
Regarding the implementation, I moved
--nocapture
out ofoptgroups()
, intoparse_opts()
, out of an abundance of caution in passing the options without a deprecated value to the usage generation. However, the usage does not actually show optional flags, so this could potentially be dropped, simplifying the PR.
This comment has been minimized.
This comment has been minimized.
You'll probably also have to adjust |
I think Thom is more familiar with |
Some changes occurred in src/tools/compiletest cc @jieyouxu |
--nocapture
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🔔 This is now entering its final comment period, as per the review above. 🔔 |
This will help with hiding some options in `--help`
This improves consistency with commonly expected CLI conventions, avoiding a common stutter people make when running tests (trying what they expect and then having to check the docs to then user whats accepted). An alternative could have been to take a value, like `--capture <value>` (e.g. `pytest` does this). Overall, we're shifting focus for features to custom test harnesses (see rust-lang#134283). Most of `pytest`s modes will likely be irrelevant in that situation. As for the rest, its too early to tell which, if any, may be relevant, so we're sticking with this small, quality of life improvement. By deprecating `--nocapture`, we intend that custom test harnesses do not need to support it for reasons outside of their own compatibility requirements, much like the deprecation in rust-lang#134283 I'm punting for now on the naming of `RUST_TEST_NOCAPTURE`. I feel like T-testing-devex should do a wider look at environment variables role in lib`test` before evaluating whether to - Deprecate it in favor of the user passing CLI flags or the test runner providing its own config - Deprecate in favor of `RUST_TEST_NO_CAPTURE` - Deprecate in favor of `RUST_TEST_CAPTURE` Other CLI flags were evaluated for casing consistency: - `--logfile` has the same problem but was deprecated in rust-lang#134283 Fixes rust-lang#133073
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
@bors r+ |
fix(test): Expose '--no-capture' in favor of `--nocapture` This improves consistency with commonly expected CLI conventions, avoiding a common stutter people make when running tests (trying what they expect and then having to check the docs to then user whats accepted). An alternative could have been to take a value, like `--capture <value>` (e.g. `pytest` does this). Overall, we're shifting focus for features to custom test harnesses (see rust-lang#134283). Most of `pytest`s modes will likely be irrelevant in that situation. As for the rest, its too early to tell which, if any, may be relevant, so we're sticking with this small, quality of life improvement. I expect we'll warn about `--nocapture` being deprecated in the future after a sufficient transition period has been allowed. By deprecating `--nocapture`, we intend that custom test harnesses do not need to support it for reasons outside of their own compatibility requirements, much like the deprecation in rust-lang#134283 I'm punting for now on the naming of `RUST_TEST_NOCAPTURE`. I feel like T-testing-devex should do a wider look at environment variables role in lib`test` before evaluating whether to - Deprecate it in favor of the user passing CLI flags or the test runner providing its own config - Deprecate in favor of `RUST_TEST_NO_CAPTURE` - Deprecate in favor of `RUST_TEST_CAPTURE` Other CLI flags were evaluated for casing consistency: - `--logfile` has the same problem but was deprecated in rust-lang#134283 Regarding the implementation, I moved `--nocapture` out of `optgroups()`, into `parse_opts()`, out of an abundance of caution in passing the options without a deprecated value to the usage generation. However, the usage does not actually show optional flags, so this could potentially be dropped, simplifying the PR. Note: `compiletest` added `--no-capture` instead of `--nocapture` in rust-lang#134809 T-testing-devex FCP: rust-lang#133073 (comment) Fixes rust-lang#133073
…enton Rollup of 10 pull requests Successful merges: - rust-lang#136160 (Remove backticks from `ShouldPanic::YesWithMessage`'s `TrFailedMsg`) - rust-lang#138395 (Download GCC from CI on test builders) - rust-lang#138737 (uefi: Update r-efi) - rust-lang#138939 (Add `Arc::is_unique`) - rust-lang#139224 (fix(test): Expose '--no-capture' in favor of `--nocapture`) - rust-lang#139546 (std(docs): clarify how std::fs::set_permisions works with symlinks) - rust-lang#139883 (crashes: more tests) - rust-lang#140345 (Avoid re-interning in `LateContext::get_def_path`) - rust-lang#140351 (docs: fix incorrect stability markers on `std::{todo, matches}`) - rust-lang#140359 (specify explicit safety guidance for from_utf8_unchecked) r? `@ghost` `@rustbot` modify labels: rollup
fix(test): Expose '--no-capture' in favor of `--nocapture` This improves consistency with commonly expected CLI conventions, avoiding a common stutter people make when running tests (trying what they expect and then having to check the docs to then user whats accepted). An alternative could have been to take a value, like `--capture <value>` (e.g. `pytest` does this). Overall, we're shifting focus for features to custom test harnesses (see rust-lang#134283). Most of `pytest`s modes will likely be irrelevant in that situation. As for the rest, its too early to tell which, if any, may be relevant, so we're sticking with this small, quality of life improvement. I expect we'll warn about `--nocapture` being deprecated in the future after a sufficient transition period has been allowed. By deprecating `--nocapture`, we intend that custom test harnesses do not need to support it for reasons outside of their own compatibility requirements, much like the deprecation in rust-lang#134283 I'm punting for now on the naming of `RUST_TEST_NOCAPTURE`. I feel like T-testing-devex should do a wider look at environment variables role in lib`test` before evaluating whether to - Deprecate it in favor of the user passing CLI flags or the test runner providing its own config - Deprecate in favor of `RUST_TEST_NO_CAPTURE` - Deprecate in favor of `RUST_TEST_CAPTURE` Other CLI flags were evaluated for casing consistency: - `--logfile` has the same problem but was deprecated in rust-lang#134283 Regarding the implementation, I moved `--nocapture` out of `optgroups()`, into `parse_opts()`, out of an abundance of caution in passing the options without a deprecated value to the usage generation. However, the usage does not actually show optional flags, so this could potentially be dropped, simplifying the PR. Note: `compiletest` added `--no-capture` instead of `--nocapture` in rust-lang#134809 T-testing-devex FCP: rust-lang#133073 (comment) Fixes rust-lang#133073
…enton Rollup of 9 pull requests Successful merges: - rust-lang#138395 (Download GCC from CI on test builders) - rust-lang#138737 (uefi: Update r-efi) - rust-lang#138939 (Add `Arc::is_unique`) - rust-lang#139224 (fix(test): Expose '--no-capture' in favor of `--nocapture`) - rust-lang#139546 (std(docs): clarify how std::fs::set_permisions works with symlinks) - rust-lang#139883 (crashes: more tests) - rust-lang#140345 (Avoid re-interning in `LateContext::get_def_path`) - rust-lang#140351 (docs: fix incorrect stability markers on `std::{todo, matches}`) - rust-lang#140359 (specify explicit safety guidance for from_utf8_unchecked) r? `@ghost` `@rustbot` modify labels: rollup
…enton Rollup of 8 pull requests Successful merges: - rust-lang#138395 (Download GCC from CI on test builders) - rust-lang#138737 (uefi: Update r-efi) - rust-lang#138939 (Add `Arc::is_unique`) - rust-lang#139224 (fix(test): Expose '--no-capture' in favor of `--nocapture`) - rust-lang#139546 (std(docs): clarify how std::fs::set_permisions works with symlinks) - rust-lang#140345 (Avoid re-interning in `LateContext::get_def_path`) - rust-lang#140351 (docs: fix incorrect stability markers on `std::{todo, matches}`) - rust-lang#140359 (specify explicit safety guidance for from_utf8_unchecked) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#139224 - epage:nocapture, r=thomcc fix(test): Expose '--no-capture' in favor of `--nocapture` This improves consistency with commonly expected CLI conventions, avoiding a common stutter people make when running tests (trying what they expect and then having to check the docs to then user whats accepted). An alternative could have been to take a value, like `--capture <value>` (e.g. `pytest` does this). Overall, we're shifting focus for features to custom test harnesses (see rust-lang#134283). Most of `pytest`s modes will likely be irrelevant in that situation. As for the rest, its too early to tell which, if any, may be relevant, so we're sticking with this small, quality of life improvement. I expect we'll warn about `--nocapture` being deprecated in the future after a sufficient transition period has been allowed. By deprecating `--nocapture`, we intend that custom test harnesses do not need to support it for reasons outside of their own compatibility requirements, much like the deprecation in rust-lang#134283 I'm punting for now on the naming of `RUST_TEST_NOCAPTURE`. I feel like T-testing-devex should do a wider look at environment variables role in lib`test` before evaluating whether to - Deprecate it in favor of the user passing CLI flags or the test runner providing its own config - Deprecate in favor of `RUST_TEST_NO_CAPTURE` - Deprecate in favor of `RUST_TEST_CAPTURE` Other CLI flags were evaluated for casing consistency: - `--logfile` has the same problem but was deprecated in rust-lang#134283 Regarding the implementation, I moved `--nocapture` out of `optgroups()`, into `parse_opts()`, out of an abundance of caution in passing the options without a deprecated value to the usage generation. However, the usage does not actually show optional flags, so this could potentially be dropped, simplifying the PR. Note: `compiletest` added `--no-capture` instead of `--nocapture` in rust-lang#134809 T-testing-devex FCP: rust-lang#133073 (comment) Fixes rust-lang#133073
This improves consistency with commonly expected CLI conventions,
avoiding a common stutter people make when running tests (trying what
they expect and then having to check the docs to then user whats
accepted).
An alternative could have been to take a value, like
--capture <value>
(e.g.pytest
does this).Overall, we're shifting focus for features to custom test harnesses (see #134283).
Most of
pytest
s modes will likely be irrelevant in that situation.As for the rest, its too early to tell which, if any, may be relevant,
so we're sticking with this small, quality of life improvement.
I expect we'll warn about
--nocapture
being deprecated in the future after a sufficient transition period has been allowed.By deprecating
--nocapture
, we intend that custom test harnesses donot need to support it for reasons outside of their own compatibility
requirements, much like the deprecation in #134283
I'm punting for now on the naming of
RUST_TEST_NOCAPTURE
.I feel like T-testing-devex should do a wider look at environment
variables role in lib
test
before evaluating whether toproviding its own config
RUST_TEST_NO_CAPTURE
RUST_TEST_CAPTURE
Other CLI flags were evaluated for casing consistency:
--logfile
has the same problem but was deprecated in fix(libtest): Deprecate '--logfile' #134283Regarding the implementation, I moved
--nocapture
out ofoptgroups()
, intoparse_opts()
, out of an abundance of caution in passing the options without a deprecated value to the usage generation. However, the usage does not actually show optional flags, so this could potentially be dropped, simplifying the PR.Note:
compiletest
added--no-capture
instead of--nocapture
in #134809T-testing-devex FCP: #133073 (comment)
Fixes #133073