-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
cargo insta test
cli: add --disable-nextest-doctest
option
#438
base: master
Are you sure you want to change the base?
Conversation
cargo insta test
cli: add --disable_nextest_doctest optioncargo insta test
cli: add --disable_nextest_doctest
option
db5982f
to
aa6c979
Compare
cargo insta test
cli: add --disable_nextest_doctest
optioncargo insta test
cli: add --disable-nextest-doctest
option
86ab0da
to
66dbc3d
Compare
Kinda wish we had a general |
66dbc3d
to
96c4d5f
Compare
96c4d5f
to
1ea5a03
Compare
1ea5a03
to
3f88ec3
Compare
One plausible alternative to this is running |
These options, for me at least, are a bit confusing, which contributes to the problem in my eyes (even though insta is probably not responsible for the confusion). Will But also, thank you, I will try it out, and it is possible that this is also a solution. (Personally, I'm still using this PR as awkward as it is, though |
2e5ad75
to
0672fb7
Compare
Yes, tbc insta is just passing those through to cargo, so while they might be a bit confusing, they're only confusing once! I would probably vote to either mimic nextest and not attempt to run doctests, or suggest passing the two options (assuming those work). Augmenting nextest and then adding an option to disable augmenting seems over-done on options... |
If we were considering breaking changes, another option would be to not run doctests by default with nextest, but have an option to do so, and perhaps a warning message if |
I don't understand all the details, but it seems that Rust is significantly reworking how doctests are run. The main goal seems to be to link them into one binary; I don't know how that affects https://rust-lang.github.io/rust-project-goals/2024h2/merged-doctests.html |
On reflection, I would support this — I think we could start this now; standard approach:
This would add an option but only temporarily, such that we'd eventually be in a place that we're just delegating test running to a test runner, which is a simple & legible place to be... |
That is probably the right way. However I do still wonder if |
This adds an option to `cargo insta test` that prevents running doctests with `cargo test` when Nextest is the test runner, even if the given targets would ortherwise include doctests. I usually use `cargo insta test` with `--test-runner nextest --workspace` options. This always runs `cargo test --doc` after nextest is done, and this takes a bit of time. This is an annoyance for me. I think the project I work on might have a doctest or two, but they are not very relevant, so I'm happy to rely on CI to catch any doctest errors. I only have a vague understanding of `cargo test` options, but I have not found an existing set of test specifiers that's equivalent to `--workspace --no-doctests-pretty-please`.
I'm not sure how appropriate this is for general use, but it's convenient if, like me, you have a project where you use this all the time.
0672fb7
to
7c193c6
Compare
FWIW given #460, I think if we don't get to the full deprecation cycle of #438 (comment), I would support just disabling the supplementary doctest run. I don't think there's a great reason for us to augment |
This adds an option to
cargo insta test
that prevents running doctests withcargo test
when Nextest is the test runner, even if the given targets would ortherwise include doctests.I usually use
cargo insta test
with--test-runner nextest --workspace
options. This always runscargo test --doc
after nextest is done and this takes a bit of time. This is an annoyance for me. I think the project I work on might have a doctest or two, but they are not very relevant, so I'm happy to rely on CI to catch any doctest errors.I only have a vague understanding of
cargo test
options, but I have not found an existing set of test specifiers that's equivalent to--workspace --no-doctests-pretty-please
.This is a bit of a quick hack, but I'll be using it, and I think others might appreciate it. If you have any thoughts about a better approach, please let me know.