Skip to content

Fix path separators in three Windows test groups (#2177) - #2179

Merged
Mikola Lysenko (mikolalysenko) merged 2 commits into
mainfrom
agent/fix-windows-test-path-separators
Nov 20, 2026
Merged

Mikola Lysenko (mikolalysenko) merged 2 commits into
mainfrom
agent/fix-windows-test-path-separators

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

LLM Description written by Claude Code:claude-fable-5-2

Fixes #2177

Summary

Three groups of tests failed on Windows in the nightly run. All three are
test-side: each built the path it expects from a /-separated string and
compared it, as text, with a path made component by component. This PR
changes only those tests (3 files, +21/-11). No product code changes.

Root cause and fix

Test group What differed on Windows Fix
gem_refresh::tests::an_unwind_names_no_rerun_for_a_shared_home The test joined "specifications/rack-1.0.0.gemspec" in one piece; the product joins the directory and the file name, so it prints ...\specifications\rack-1.0.0.gemspec. Join the directory and the file name separately.
8 Java gem tests in e2e_gem_native_ext_build JavaGem::vendor_rel kept the / of the strings gem_dir was joined from (bundle/jruby/3.1.0\gems/...); the directory walk it is compared with yields \ throughout. The product wrote the right files once; the "duplicate" entries in the diff were the two spellings of one path. Rebuild the relative path from its components.
2 tests in get_update_summary_e2e The save line names the manifest as --cwd joined with the manifest path: .\.socket/manifest.json on Windows, ./.socket/manifest.json elsewhere. The test hard-coded the Unix form. Expect the path as the platform joins it.

Evidence

  • Red: main's scheduled run 44682782099 and the dispatch run 44711932605
    (both Windows test legs) fail these 11 tests.
  • Green: os=windows dispatch run 44745615345 on this head (15fbac0).
    test (windows-latest, 1) passes, including the gem_refresh test.
    In test (windows-latest, 2) all 8 Java gem tests and both get summary
    tests pass.
  • Still red on that run, and not this PR's: test (windows-latest, 2)
    fails on one test,
    scan_project_discovery_e2e::agent_scan_names_a_python_project_below_with_its_own_venv.
    That is Windows: agent_scan_names_a_python_project_below_with_its_own_venv fails (test builds a Unix venv layout) #2149, which Fix the Windows venv layout of a scan discovery test (#2149) #2176 fixes. ci-ok (windows only) is red for that
    reason alone. With both PRs merged, the Windows legs should be green.
  • Local (Linux): the three test groups pass;
    cargo clippy --locked -p socket-patch-cli --all-features -- -D warnings
    is clean. With --all-targets, clippy fails the same way on
    origin/main without this change (lints in test targets CI does not
    run clippy on), so I left that alone.
  • /code-review high found no defect in the diff.

Follow-ups (not in this PR; both change CLI output, so they need a maintainer's call)

  • On Windows, get --save-only prints Saved 1 patch to .\.socket/manifest.json:
    mixed separators and a redundant .\. Cosmetic; the file is written
    correctly. The test now matches what the product prints.
  • On Windows, the shared gem home remedy still prints a POSIX command
    (rm -f '<path>' ... && bundle install), which cmd.exe cannot run.

https://claude.ai/code/session_011f9aeSxwTj97uP4xQonHdq


Generated by Claude Code

Refs #2177.

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_011f9aeSxwTj97uP4xQonHdq
Three groups of tests failed on Windows in the nightly run. Each one
built the path it expects from a '/'-separated string and compared
it as text with a path made component by component:

- gem_refresh: the rm command of a shared gem home joined
  "specifications/rack-1.0.0.gemspec" in one piece, where the
  product joins the directory and the file name.
- Java gem e2e: vendor_rel kept the '/' of the strings gem_dir was
  joined from, where the directory walk yields '\'.
- get update summary e2e: the save line names the manifest as
  --cwd joined with the manifest path, '.\.socket/manifest.json'
  on Windows.

The tests now build their expected paths the way the other side
does. No product code changes.

Fixes #2177

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_011f9aeSxwTj97uP4xQonHdq
@mikolalysenko
Mikola Lysenko (mikolalysenko) marked this pull request as ready for review November 20, 2026 14:06
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

bugbot run


Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

[agent] test (windows-latest, 2) and ci-ok (windows only) on this head come from the os=windows dispatch run I started to prove the fix (run 44745615345). The one test that still fails there is scan_project_discovery_e2e::agent_scan_names_a_python_project_below_with_its_own_venv, which is #2149 and is fixed by #2176, not by this PR. All 11 tests of #2177 pass in that run. Neither check is required for merging.


Generated by Claude Code

@cursor

cursor Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Test-only path formatting fixes; no runtime or CLI behavior changes.

Overview
Fixes Windows nightly failures in three test-only areas where expectations compared string-built paths (often with /) against component-joined paths the CLI or file walk actually emits (backslashes on Windows).

In gem_refresh, the shared-home unwind remedy assertion now builds rm -f paths the same way as production (home.join("specifications").join(...)), not via a single slash-separated suffix.

In e2e_gem_native_ext_build, JavaGem::vendor_rel reconstructs the relative path from Path components so vendor tree comparisons match walk_files on Windows.

In get_update_summary_e2e, a new manifest_label() helper expects the save line to use the platform’s default join of . and .socket/manifest.json instead of a hard-coded ./.socket/manifest.json.

No production code changes—only test expectations aligned with existing behavior.

Reviewed by Cursor Bugbot for commit 15fbac0. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 15fbac0. Configure here.

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

[agent] PR shepherd: review brief for the approver

What it does
Fixes 11 tests that fail only on Windows (#2177). Each built its expected path from a /-separated string and compared it as text with a path the product builds component by component. Test code only; no product code changes.

Risk: low. Three test files, +21/-11. Nothing that ships to users changes. The worst case is a test that still fails on Windows, which only the nightly Windows legs run.

Look here

  • gem_refresh.rs:1668: expected remedy paths are now joined per component, which is how the product builds them (gem_refresh.rs:358).
  • [e2e_gem_native_ext_build.rs:3185](https://github.com/SocketDev/socket-patch/blob/15fbac0b2093c91f40e05fb2c275eaafea1a1a7d/crates/socket-patch-cli/tests/e2e_gem_native_ext_build.rs#L3185): vendor_rel rebuilds the relative path from components(), so separators match the directory walk.
  • [get_update_summary_e2e.rs:91](https://github.com/SocketDev/socket-patch/blob/15fbac0b2093c91f40e05fb2c275eaafea1a1a7d/crates/socket-patch-cli/tests/get/get_update_summary_e2e.rs#L91): manifest_label() expects the save line's path as the platform joins it.

Verified

Changes I made: none.

Open questions: none for this PR. The description lists two Windows output follow-ups (mixed separators in get --save-only, and a POSIX rm remedy on Windows). Both change CLI output, so they need a separate decision from a maintainer.


Generated by Claude Code

@mikolalysenko Mikola Lysenko (mikolalysenko) added the Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review label Nov 20, 2026
Merged via the queue into main with commit 64657ee Nov 20, 2026
173 of 175 checks passed
@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the agent/fix-windows-test-path-separators branch November 20, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows nightly: gem_refresh shared-home text, Java gem e2e and get update summary tests fail on main

3 participants