Skip to content

Fix Windows nightly: expect /-separated scan headings - #2061

Open
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
mainfrom
ci-janitor/windows-scan-heading
Open

Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
mainfrom
ci-janitor/windows-scan-heading

Conversation

@mikolalysenko

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

Copy link
Copy Markdown
Collaborator

Problem

The scheduled CI run on main failed on 2026-11-12 (run 43163115418, job test (windows-latest, 2)). It failed on one test:

scan_render::scan_hosted_paths_run_once_per_project_directory ... FAILED
panicked at crates\socket-patch-cli\tests\scan\scan_render.rs:1524:9:
missing "== apps\\a ==":
== apps/a ==
...

#2052 added this test. Windows legs run only nightly, so the PR and the merge queue never ran it on Windows. It fails every time on Windows, not now and then. The nightly had only just gone green after #2049 (2026-11-11), and this test turned it red again.

Root cause

The test built the expected heading with Path::new("apps").join(app).display(), which gives apps\a on Windows. But scan names each project directory through projects_below::shown_project_dir, which strips --cwd and prints / separators on every OS on purpose. list and rollback print their headings the same way. The product is right; the test's expectation was wrong.

Fix

Assert == apps/{app} ==, which is what the CLI prints on every OS, and drop the std::path::Path import that is no longer used. No product code changes.

Proof

  • Linux: cargo test -p socket-patch-cli --test scan scan_render gives 41 passed, 0 failed.
  • The Windows log above shows the CLI printing == apps/a == and == apps/b ==. Those are exactly the strings the test now expects.
  • rustfmt ran on the touched file only. cargo clippy -p socket-patch-cli --test scan -- -D warnings reports nothing in scan_render.rs. It does report needless_borrow errors in tests/prebuilt_common/mod.rs, which this PR doesn't touch. Those come from the same clippy run on main's own commit and are not from this change.

No tests are removed or moved.


Generated by Claude Code


Generated by Claude Code

scan_hosted_paths_run_once_per_project_directory (added in #2052)
built its expected `== apps\a ==` heading with Path::join, but
`scan` names each project directory through shown_project_dir,
which prints `/` separators on every OS. The test fails
deterministically on windows-latest, so the nightly CI run on main
went red on 2026-11-12. Assert the `/` form the CLI actually prints.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011f9aePpg46bxXWCYNj6tAX
@mikolalysenko Mikola Lysenko (mikolalysenko) added the ci-janitor Opened by the CI janitor routine (flakes, redundant tests, CI perf) label Nov 12, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

bugbot run


Generated by Claude Code

@cursor

cursor Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Test-only assertion and comment updates; no runtime or CLI behavior changes.

Overview
Fixes a Windows nightly failure in scan_hosted_paths_run_once_per_project_directory by aligning test expectations with how scan actually prints per-project headings.

The test no longer builds expected headers with Path::join / display() (native \ on Windows). It now asserts == apps/{app} ==, matching shown_project_dir behavior where headings are always /-separated on every OS. The unused std::path::Path import is removed and the comment documents why.

No product or CLI behavior changes—tests only.

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

@mikolalysenko Mikola Lysenko (mikolalysenko) added the Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review label Nov 12, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Ready for review at 467b616.

  • CI: 50/50 checks done, none failed (31 success incl. ci-ok and clippy, 19 skipped by path filters). No main-wide failures.
  • Bugbot: reviewed 467b616, no findings.
  • Mergeable: yes, no conflicts with main.
  • For the reviewer: test-only change in crates/socket-patch-cli/tests/scan/scan_render.rs; the real confirmation is the next nightly windows-latest run.
  • Slack announcement not sent this run (Slack send unavailable); the next run will retry.

Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Final review brief

What it does: Fixes the red Windows nightly. The new scan_hosted_paths_run_once_per_project_directory test (from #2052) expected == apps\a == on Windows, but scan prints headings through shown_project_dir, which always uses /. The test now expects == apps/{app} == on every OS. Test-only change; no product code.

Risk: low. One assertion in one integration test plus an unused import removed.

Look here:

  • [scan_render.rs:1519-1525](https://github.com/SocketDev/socket-patch/blob/467b616c1222a593638d5615294bdc9e1c0f5552/crates/socket-patch-cli/tests/scan/scan_render.rs#L1519-L1525): the new expected heading
  • [projects_below.rs:184-189](https://github.com/SocketDev/socket-patch/blob/467b616c1222a593638d5615294bdc9e1c0f5552/crates/socket-patch-cli/src/commands/projects_below.rs#L184-L189): shown_project_dir replaces \\ with /, which confirms the new expectation
  • [scan/mod.rs:1780-1781](https://github.com/SocketDev/socket-patch/blob/467b616c1222a593638d5615294bdc9e1c0f5552/crates/socket-patch-cli/src/commands/scan/mod.rs#L1780-L1781): scan prints its heading through it

Verified: read the full diff; confirmed that the scan heading path goes through shown_project_dir; the Windows failure log in the description shows the CLI printing == apps/a ==; CHANGELOG.md untouched. CI: ci-ok and clippy green on the head; Cursor Bugbot passed with no findings. Windows legs run only nightly, so the next nightly will confirm the fix on Windows.

Changes I made: none.

Open questions: none.

Auto-merge is armed, so approving sends it straight to the merge queue.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-janitor Opened by the CI janitor routine (flakes, redundant tests, CI perf) 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.

2 participants