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

cargo insta test cli: add --disable-nextest-doctest option #438

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ilyagr
Copy link

@ilyagr ilyagr commented Feb 4, 2024

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.


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.

@ilyagr ilyagr changed the title cargo insta test cli: add --disable_nextest_doctest option cargo insta test cli: add --disable_nextest_doctest option Feb 4, 2024
@ilyagr ilyagr changed the title cargo insta test cli: add --disable_nextest_doctest option cargo insta test cli: add --disable-nextest-doctest option Feb 4, 2024
@ilyagr ilyagr force-pushed the disablenextestdoctest branch 2 times, most recently from 86ab0da to 66dbc3d Compare February 4, 2024 05:28
@mitsuhiko
Copy link
Owner

Kinda wish we had a general --no-doc option but not sure how to make this work for regular cargo test. I will dive into it.

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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants