-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Clarify in --help
that cargo test --all-targets
excludes doctests
#12422
Conversation
r? @epage (rustbot has picked a reviewer for you, use r? to override) |
I left a comment over at #6669 (comment). This isn't a review on this PR (I'll leave that up to epage), but just a passing comment that saying "except doctests" might imply that a doctest is a target (which it isn't). I would probably word this like I do agree it is helpful to clarify, so thank you for opening this! |
I think at least clarifying the webpage / man page / As for the ``-h |
src/bin/cargo/commands/test.rs
Outdated
@@ -34,7 +34,7 @@ pub fn cli() -> Command { | |||
"Test all tests", | |||
"Test only the specified bench target", | |||
"Test all benches", | |||
"Test all targets", | |||
"Test all targets except doctests", |
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.
I would probably word this like (does not include doctests) or something like that, but I am splitting hairs and the exact wording isn't important to me, just a suggestion if you like it better.
I like the suggestion for it being paranthetical
I think I also prefer wording besides "except" makes it sound like we are actively excluding it
does not include
is okprecludes
might also work
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.
I can switch to does not include
with a parenthetical.
Though, one thing that phrasing doesn't address or even hint at is that cargo test
without this flag does run doctests. From that perspective, adding this flag does have the effect of actively excluding doctests, even though I understand the difference in intent there.
I don't feel like I understand the finer points of targets well enough to tackle the "docs text implies doctests are a target" issue in the links you shared, but I did open another PR to add a clarification for the |
I'm running into some linking-related problem where even though I have I tried to edit the snapshot test by hand so as not to block this PR on the issues with my local setup. |
Off topic but I am interested in this. If you are okay with it please share the detail on zulip or in a new issue :) |
Per my proposal here: rust-lang#6669 (comment) I tried to keep the edit minimalistic to match the surrounding style. If the maintainers are amenable to it, I think it could also be useful to do one or more of: - Offer concrete guidance on what to do to run actually-all tests (`--all-targets` then separately `--doc`). - Link to the issue at: rust-lang#6669 - Mention that `cargo test` without `--all-targets` runs doctests by default, which seems not immediately obvious. I'd be happy to attempt to add any of the above that the maintainers feel would be a good fit here.
cargo test --all-targets
excludes doctests--help
that cargo test --all-targets
excludes doctests
Thanks! @bors r+ |
☀️ Test successful - checks-actions |
Update cargo 8 commits in c91a693e7977e33a1064b63a5daf5fb689f01651..6dc1deaddf62c7748c9097c7ea88e9ec77ff1a1a 2023-07-31 00:26:46 +0000 to 2023-08-02 00:23:54 +0000 - `#[allow(internal_features)]` in RUSTC_BOOTSTRAP test (rust-lang/cargo#12429) - ci: rewrite bump check and respect semver (rust-lang/cargo#12395) - fix(update): Tweak CLI behavior (rust-lang/cargo#12428) - chore(deps): update compatible (rust-lang/cargo#12426) - Display crate version on timings graph (rust-lang/cargo#12420) - chore(deps): update alpine docker tag to v3.18 (rust-lang/cargo#12427) - Use thiserror for credential provider errors (rust-lang/cargo#12424) - Clarify in `--help` that `cargo test --all-targets` excludes doctests (rust-lang/cargo#12422) r? `@ghost`
Update cargo 8 commits in c91a693e7977e33a1064b63a5daf5fb689f01651..6dc1deaddf62c7748c9097c7ea88e9ec77ff1a1a 2023-07-31 00:26:46 +0000 to 2023-08-02 00:23:54 +0000 - `#[allow(internal_features)]` in RUSTC_BOOTSTRAP test (rust-lang/cargo#12429) - ci: rewrite bump check and respect semver (rust-lang/cargo#12395) - fix(update): Tweak CLI behavior (rust-lang/cargo#12428) - chore(deps): update compatible (rust-lang/cargo#12426) - Display crate version on timings graph (rust-lang/cargo#12420) - chore(deps): update alpine docker tag to v3.18 (rust-lang/cargo#12427) - Use thiserror for credential provider errors (rust-lang/cargo#12424) - Clarify in `--help` that `cargo test --all-targets` excludes doctests (rust-lang/cargo#12422) r? ``@ghost``
Update cargo 10 commits in c91a693e7977e33a1064b63a5daf5fb689f01651..020651c52257052d28f6fd83fbecf5cfa1ed516c 2023-07-31 00:26:46 +0000 to 2023-08-02 16:00:37 +0000 - Update rustix to 0.38.6 (rust-lang/cargo#12436) - replace `master` branch by default branch in documentation (rust-lang/cargo#12435) - `#[allow(internal_features)]` in RUSTC_BOOTSTRAP test (rust-lang/cargo#12429) - ci: rewrite bump check and respect semver (rust-lang/cargo#12395) - fix(update): Tweak CLI behavior (rust-lang/cargo#12428) - chore(deps): update compatible (rust-lang/cargo#12426) - Display crate version on timings graph (rust-lang/cargo#12420) - chore(deps): update alpine docker tag to v3.18 (rust-lang/cargo#12427) - Use thiserror for credential provider errors (rust-lang/cargo#12424) - Clarify in `--help` that `cargo test --all-targets` excludes doctests (rust-lang/cargo#12422) r? `@ghost`
Update cargo 10 commits in c91a693e7977e33a1064b63a5daf5fb689f01651..020651c52257052d28f6fd83fbecf5cfa1ed516c 2023-07-31 00:26:46 +0000 to 2023-08-02 16:00:37 +0000 - Update rustix to 0.38.6 (rust-lang/cargo#12436) - replace `master` branch by default branch in documentation (rust-lang/cargo#12435) - `#[allow(internal_features)]` in RUSTC_BOOTSTRAP test (rust-lang/cargo#12429) - ci: rewrite bump check and respect semver (rust-lang/cargo#12395) - fix(update): Tweak CLI behavior (rust-lang/cargo#12428) - chore(deps): update compatible (rust-lang/cargo#12426) - Display crate version on timings graph (rust-lang/cargo#12420) - chore(deps): update alpine docker tag to v3.18 (rust-lang/cargo#12427) - Use thiserror for credential provider errors (rust-lang/cargo#12424) - Clarify in `--help` that `cargo test --all-targets` excludes doctests (rust-lang/cargo#12422) r? `@ghost`
Per my proposal here: #6669 (comment)
I tried to keep the edit minimalistic to match the surrounding style.
If the maintainers are amenable to it, I think it could also be useful to do one or more of:
--all-targets
then separately--doc
).cargo test --all-targets
does not run doc tests #6669cargo test
without--all-targets
runs doctests by default, which seems not immediately obvious.I'd be happy to attempt to add any of the above that the maintainers feel would be a good fit here.