test: migrate show_settings and version tests to use CliTest#23702
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 <[email protected]>
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.
|
|
@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 |
|
I think I'll just push a couple of commits here to address my own feedback, but thank you for the offer. |
|
@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. |
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