test(windows): fix secret_scan + uninstall path assertions on Windows#507
Conversation
Two Windows-only test failures, both fixture-side:
- ext_builder::secret_scan: the expected offending path was built with
dir.join("src/config.ts"), whose forward-slash suffix stays literal on
Windows (backslash root + "/config.ts"), while the scanner returns a
native all-backslash path. Build the expected with sequential joins so
it uses the native separator.
- application::uninstall: validate_data_path_rejects_missing passed
"/tmp/__asyar_nonexistent_data_path__", which is not absolute on
Windows, so the absolute-path check rejected it before the missing-path
check the test asserts (NotFound). Derive an absolute-but-missing path
from the fake home's temp dir instead.
Fixes the last of the 38 Windows failures surfaced by Xoshbin#499 (see Xoshbin#498),
excluding the 6 agents::builtin_tools::shell_test cases deliberately left
for the in-flight agents rework. No product change.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MGJAx66y29o33szDvVYTBH
There was a problem hiding this comment.
Code Review
This pull request improves cross-platform compatibility in the test suite by replacing hardcoded Unix-style file paths with platform-independent path constructions using PathBuf::join. Specifically, it updates tests in uninstall.rs and secret_scan.rs to ensure they run correctly on Windows as well as Unix-like systems. There are no review comments to address, and I have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Final slice of the 38 Windows test failures surfaced once #499 made
cargo testloadable on Windows (context in #498). Test-only — no product change.The failures
ext_builder::secret_scan(2 tests) — the expected offending path was built withdir.join("src/config.ts"). On Windows the forward-slash suffix stays literal (backslash root +/config.ts), while the scanner walks the tree and returns a native all-backslash path, so the equality assertion differed only by separator. Build the expected with sequential.join("src").join("config.ts")so it uses the native separator.application::uninstall::…::validate_data_path_rejects_missing(1 test) — it passed"/tmp/__asyar_nonexistent_data_path__", which is not absolute on Windows, sovalidate_data_path_under_homereturned itsValidation("must be absolute")error before reaching the missing-path (NotFound) branch the test asserts. Derive an absolute-but-missing path from the fake home's temp dir instead, so the missing-path check is what fires on every platform.Verification
cargo test secret_scanandcargo test uninstallgreen, including the three previously-failing tests.cargo testgreen (knownfs_watcherinotify env failure aside);cargo clippy --all-targets -- -D warningsandcargo fmtclean.Context
This is the last of the Windows test-portability fixes. With #503–#506 and this PR,
cargo testpasses on Windows except for the 6agents::builtin_tools::shell_testcases, which are intentionally left alone because a separate in-flight PR reworks that area.🤖 Generated with Claude Code