Skip to content

Fix hot-patch test path on Windows (#2080) - #2082

Open
Mikola Lysenko (mikolalysenko) wants to merge 2 commits into
mainfrom
agent/fix-hot-patch-test-windows-path
Open

Mikola Lysenko (mikolalysenko) wants to merge 2 commits into
mainfrom
agent/fix-hot-patch-test-windows-path

Conversation

@mikolalysenko

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

Copy link
Copy Markdown
Collaborator

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

Fixes #2080

Summary

A test-only change. hot_patch::tests::a_start_is_a_project_pass_then_a_global_pass
fails on Windows, which has kept the scheduled main run's
test (windows-latest, 1) leg, and so ci-ok on main, red since #2068.
The two manifest-path assertions now compare paths instead of strings.

Root cause

passes() builds each pass's manifest path with Path::join, which writes
the platform's separator. The test compared the result to a /-joined
string literal:

left:  "/state\\project\\manifest.json"
right: "/state/project/manifest.json"

The product code is right: the path is handed to the scan as a path, and
either separator works on Windows. Only the test's expectation was wrong.
Path equality compares components, and Windows parses both / and \
as separators, so comparing as Paths keeps the readable literal and holds
on every platform. Both assertions (project pass and global pass) are
changed; they are the only /state/... string comparisons in the file, and
the failing job's log shows no other failed test.

Evidence

  • Failing run on main (63f791d): https://github.com/SocketDev/socket-patch/actions/runs/43562815783, job test (windows-latest, 1); that test is its only failure.
  • Green on Windows at this head (5fffc73): a PR run skips the Windows test legs, so I dispatched CI with os=windows on the branch. https://github.com/SocketDev/socket-patch/actions/runs/43600463417: test (windows-latest, 1) (the leg that failed on main), test (windows-latest, 2) and ci-ok (windows only) all pass.
  • cargo test -p socket-patch-cli --lib: 943 passed, 0 failed (Linux).
  • cargo clippy --locked --workspace --all-features -- -D warnings (CI's command): clean.
  • rustfmt --check on the touched file: clean.
  • /code-review high on the diff: no findings. Cursor Bugbot: no issues.

Note: cargo clippy -p socket-patch-cli --all-targets --all-features -- -D warnings
fails locally on unmodified origin/main too (duplicate_mod and
format_in_format_args in test targets). CI doesn't lint test targets, so
it isn't visible there, and it isn't part of this change.

https://claude.ai/code/session_011f9aePVwfWQikf61EL6Ec7


Generated by Claude Code

Refs #2080

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_011f9aePVwfWQikf61EL6Ec7
passes() builds each pass's manifest path with Path::join, which
writes the platform's separator. The test compared the result to a
/-joined string, so it failed on Windows and kept the scheduled main
run red. Compare the two as paths instead: a / in a literal is a
separator on every platform, so the expectation stays readable and
holds on Windows too.

Fixes #2080

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

Copy link
Copy Markdown
Collaborator Author

bugbot run


Generated by Claude Code

@cursor

cursor Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Test-only assertion change with no impact on production hot-patch behavior.

Overview
Makes a_start_is_a_project_pass_then_a_global_pass assert project and global manifest locations with Path equality instead of raw string equality, so Windows CI passes when passes() stores paths built via Path::join (backslashes) against forward-slash literals.

No runtime behavior changes—only the test expectation is corrected, with a short comment explaining why Path comparison is used.

Reviewed by Cursor Bugbot for commit 5fffc73. 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 5fffc73. Configure here.

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

[agent] PR shepherd: review brief for the approver

What it does: This only changes a test. hot_patch::tests::a_start_is_a_project_pass_then_a_global_pass now compares the two manifest paths as Paths, not as strings, so it passes on Windows, where Path::join writes \\. That should turn the nightly main run's test (windows-latest, 1) leg (and ci-ok on main) green again (#2080).

Risk: Low. Test-only, two assertions in one file, and no product code changes.

Look here

  • // Compared as paths: the separator `Path::join` writes is the
    // platform's, and a `/` in a literal is one on every platform.
    assert_eq!(
    Path::new(&project.common.manifest_path),
    Path::new("/state/project/manifest.json")
    );
    : the project-pass assertion
  • assert_eq!(
    Path::new(&global.common.manifest_path),
    Path::new("/state/global/manifest.json")
    );
    : the global-pass assertion
  • fn passes(args: &ScanArgs, state: &Path) -> Vec<(&'static str, ScanArgs)> {
    let with_manifest = |mut pass: ScanArgs, scope: &'static str| {
    pass.common.manifest_path = state
    .join(scope)
    .join("manifest.json")
    .to_string_lossy()
    : passes(), which builds the path with Path::join (unchanged)

Verified

Changes I made: none.

Open questions: none.


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 14, 2026
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: hot_patch test compares a Path::join result against a /-joined string (main CI red since #2068)

2 participants