test: migrate show_settings and version tests to use CliTest#23702
Merged
ntBre merged 6 commits intoastral-sh:mainfrom Mar 18, 2026
Merged
test: migrate show_settings and version tests to use CliTest#23702ntBre merged 6 commits intoastral-sh:mainfrom
show_settings and version tests to use CliTest#23702ntBre merged 6 commits intoastral-sh:mainfrom
Conversation
Move `show_settings.rs` and `version.rs` from standalone test files into the `cli/` module to use the shared `CliTest` test fixture, reducing boilerplate for tempdir management, snapshot filtering, and command creation. Part of astral-sh#19016. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ntBre
reviewed
Mar 3, 2026
Contributor
ntBre
left a comment
There was a problem hiding this comment.
Thanks, this looks reasonable to me. I just had a few small questions/suggestions.
|
Contributor
|
@Beltranss Sorry to interrupt. I just want to know whether you’re working on this right now. If not, would it be okay for me to take it and finish it? Cc: @ntBre |
Contributor
|
I think I'll just push a couple of commits here to address my own feedback, but thank you for the offer. |
Contributor
|
@ntBre Thanks for the quick response. I mean, it doesn’t look like there’s been any progress on this for a while, so I asked @Beltranss whether he is working on it now. If not, I can open my PR that reflects your feedback. |
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
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
Part of #19016.
Migrates two standalone test files into the
cli/module to use the sharedCliTesttest fixture, reducing boilerplate:show_settings.rs— Removed manualTempDircreation,dunce::canonicalize,insta::with_settings!filters, andCommand::new(get_cargo_bin(...)). Now usesCliTest::with_filesandtest.command().version.rs— Wrapped in aVersionTeststruct (same pattern asAnalyzeTestincli/analyze_graph.rs) to add the version-specific regex filter viaCliTest::with_settings. Removed directTempDirandget_cargo_binusage.AI Assistance Disclosure
This PR was written with the assistance of Claude Code (Claude Opus). The migration, test verification, and snapshot regeneration were done with AI assistance.
Test plan
cargo test -p ruff --test cli)🤖 Generated with Claude Code