-
-
Notifications
You must be signed in to change notification settings - Fork 134
Add --disable-nextest-doctest flag and deprecation warning #803
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This change adds a deprecation warning when using nextest with doctests, as insta won't run a separate doctest process when using nextest in the future. Users can pass --disable-nextest-doctest to opt into the new behavior now and silence the warning. Changes: - Add --disable-nextest-doctest flag to skip doctest execution with nextest - Add has_doctests() function to detect if packages contain doctests - Show warning when nextest is used with doctests present - Add comprehensive functional tests for the new behavior 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add nextest installation to test jobs that run cargo-insta tests. This ensures the new nextest doctest tests can run successfully in CI. Uses taiki-e/install-action@nextest for efficient installation.
max-sixty
commented
Sep 9, 2025
Merged
max-sixty
added a commit
that referenced
this pull request
Nov 20, 2025
## Summary Prepare for the 1.44.0 release: - Bump version to 1.44.0 in `insta/Cargo.toml` and `cargo-insta/Cargo.toml` - Update CHANGELOG.md with all changes since 1.43.2 ## Changes in 1.44.0 - Added non-interactive snapshot review and reject modes for use in non-TTY environments (LLMs, CI pipelines, scripts) #815 - Add `--disable-nextest-doctest` flag with deprecation warning #803 - Add ergonomic `--test-runner-fallback` / `--no-test-runner-fallback` flags #811 - Apply redactions to snapshot metadata #813 - Remove confusing 'previously unseen snapshot' message #812 - Speed up JSON float rendering #806 (@nyurik) - Allow globset version up to 0.4.16 #810 (@g0hl1n) - Improve documentation #814 (@tshepang) - Enforce starting newlines in assertions #563 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
|
It seems like people will pass this flag often to avoid the deprecation warning. Perhaps give it a short versin, e.g. |
Collaborator
Author
|
yes OK! |
|
I like -D but --dnd is also ok. It's temporary anyway. |
4 tasks
max-sixty
added a commit
that referenced
this pull request
Nov 20, 2025
## Summary Adds a shorter `--dnd` alias for the `--disable-nextest-doctest` flag to make it easier to silence the deprecation warning during the transition period. This addresses the request from @ilyagr in #803: > It seems like people will pass this flag often to avoid the deprecation warning. Perhaps give it a short version, e.g. `-D`? After discussion, we agreed on `--dnd` as the alias. ## Changes - Add `alias = "dnd"` to the `disable_nextest_doctest` CLI argument - Update deprecation warning message to mention the `--dnd` alias: `Pass '--disable-nextest-doctest' (or '--dnd') to update to this behavior now and silence this warning.` - Add test `test_nextest_doctest_dnd_alias_no_warning()` to verify the alias works correctly ## Test plan - [x] All existing tests pass (5/5 in nextest_doctest module) - [x] New test verifies `--dnd` alias works correctly - [x] Lints pass (cargo fmt, cargo clippy) - [x] Manual verification: `cargo insta test --test-runner nextest --dnd` works as expected ## Usage Both forms work identically: ```bash cargo insta test --test-runner nextest --disable-nextest-doctest cargo insta test --test-runner nextest --dnd ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
--disable-nextest-doctestflag to disable running separate doctests when using nextest--disable-nextest-doctestto opt into the new behavior now and silence the warningChanges
--disable-nextest-doctestflag toTestCommandstructhas_doctests()function that checks if any packages contain doctests by scanning for/// ```` or//! ```` patterns in source files--disable-nextest-doctestflag is not setTest Plan
✅ All existing tests pass
✅ Added 4 new functional tests that verify the behavior
✅ Manually tested with
cargo run --package cargo-insta -- test --test-runner nextest✅ Code passes clippy and rustfmt checks
🤖 Generated with Claude Code