Repository navigation
Fix gem remedy unit test for quoted Windows paths (#2399) - #2405
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
Conversation
The test of a copy beside another Ruby's tree built the expected rm command from Path::display(), but the remedy quotes each path as one shell word. A Windows temp path holds a backslash and a tilde, so the nightly Windows leg failed on every run. The test also joined the gemspec path with a slash inside one part, which Windows keeps as a slash while the remedy joins part by part. Build the expected commands with shell_word and join the gemspec path part by part. The assertions are unchanged. Fixes #2399 Assisted-by: Claude Code:claude-fable-5-2 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011f9aePyMvbD6rKimV9v2pL
|
bugbot run Generated by Claude Code |
PR SummaryLow Risk Overview The test now builds the gemspec path with separate No product code or assertion semantics change. Reviewed by Cursor Bugbot for commit 0368b54. Configure here. |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 0368b54. Configure here.
|
[agent] PR shepherd: review brief for the approver What it does Risk Look here
Verified
Changes I made Open questions Generated by Claude Code |
LLM Description written by Claude Code:claude-fable-5-2
Fixes #2399
Summary
Test-only change, 8 lines in one unit test. The nightly
test (windows-latest, 1)leg has failed onmainfour nights in a row oncommands::gem_refresh::tests::a_copy_beside_another_rubys_tree_is_removed_with_its_gem_dir. No product code changes and no assertion is loosened.Root cause
The remedy quotes every path of its
rm -f … && bundle installcommand as one shell word (shell_word). The test built the expected command from the unquotedPath::display(). On Linux a temp path needs no quotes, so the two agree. A Windows temp path (C:\Users\RUNNER~1\…) holds\and~, so the remedy quotes it and the test's unquoted text is not found. An earlier fix covered the other gem remedy tests in this file. This test was added after it.A second mismatch sat behind the first: the test joined the gemspec path as
home.join("specifications/json-1.0.0.gemspec"). Windows keeps the/inside a joined part, while the remedy joinsspecificationsand the file name separately and gets\.Change
rm -rfandrm -fcommands withshell_word, as the neighboring tests do.The warning's detail (
remove <dir>, <spec> and run …) lists paths unquoted, and the test still expects them unquoted.Evidence
No Windows machine was available, so the quoting failure was reproduced on Linux by running the test under a temp directory whose path needs quoting:
With the default temp directory all 14 tests pass before and after.
Not verified here: the Windows separator mismatch (the second cause) cannot be reproduced on Linux. It is read from the nightly's output, which prints
…3.2.0\specifications\json-1.0.0.gemspec. The Windows test leg runs only nightly, so the first proof is the next nightly run onmainafter this merges.Local checks:
rustfmt --checkon the file;cargo clippy --locked -p socket-patch-cli --all-features -- -D warnings(the form CI runs) is clean. With--all-targetsclippy reports findings in integration-test helpers this PR does not touch (tests/prebuilt_common/mod.rs,tests/common/mod.rsand others); they are the same onmainand none is ingem_refresh.rs.Review
/code-review highon the diff: no finding in the changed lines. One pre-existing note in production code the test exercises, not fixed here: the remedy is a POSIX shell command (rm -f '…' && bundle install) on every platform, so on Windows it runs in Git Bash but not in cmd.exe or Windows PowerShell. Changing that changes CLI output, which is a maintainer's call and outside a test fix.https://claude.ai/code/session_011f9aePyMvbD6rKimV9v2pL
Generated by Claude Code