Repository navigation
Fix the Windows venv layout of a scan discovery test (#2149) - #2176
Mikola Lysenko (mikolalysenko) merged 3 commits into
Conversation
Refs #2149. Assisted-by: Claude Code:claude-fable-5-2
agent_scan_names_a_python_project_below_with_its_own_venv staged a Unix venv (.venv/lib/python3.12/site-packages) on every platform. On Windows the Python crawler reads a venv's packages from Lib/site-packages, so the staged project had no install directory of its own, the scan named no project as not scanned, and the test failed on every Windows run. Stage the layout the crawler reads on the platform the test runs on. Fixes #2149. Assisted-by: Claude Code:claude-fable-5-2
scan_ignores_ambient_virtual_env planted its decoy venv with the Unix layout on every platform. On Windows the Python crawler reads Lib/site-packages, so the decoy package was invisible whether or not VIRTUAL_ENV was scrubbed, and the guard could not fail there. Stage the layout the crawler reads on the platform, as the scan discovery test now does. Refs #2149. Assisted-by: Claude Code:claude-fable-5-2
|
bugbot run Generated by Claude Code |
PR SummaryLow Risk Overview Both Reviewed by Cursor Bugbot for commit 9caa51b. Configure here. |
|
[agent]
Generated by Claude Code |
|
[agent] PR shepherd: review brief for the approver What it does. Two scan tests built a Unix venv ( Risk: low. Only test fixtures change, and the Unix path of each is byte-for-byte the same as before. Nothing ships to users. Look here
Verified
Changes I made: none. Open questions: none. Generated by Claude Code |
|
[agent] The merge queue dropped this PR on a network error, not on a test. In the queue's CI run (44758585595) the This PR changes two test fixtures and nothing that step uses. Its head is unchanged (9caa51b), it is approved and mergeable, and auto-merge was turned off by the dequeue. It needs to be put back in the merge queue; I have not re-armed auto-merge myself. Generated by Claude Code |
LLM Description written by Claude Code:claude-fable-5-2
Fixes #2149
Summary
Two scan tests staged a Unix venv (
lib/python3.x/site-packages) onevery platform. On Windows the Python crawler reads a venv's packages
from
Lib/site-packages, so the staged package was invisible there.Both tests now stage the layout the crawler reads on the platform they
run on. Test-only: 2 files, no product code, no test skipped or loosened.
scan_project_discovery_e2e::agent_scan_names_a_python_project_below_with_its_own_venvin_process_scan::scan_ignores_ambient_virtual_envVIRTUAL_ENVscrub cannot failRoot cause
The product code is platform-aware (
find_site_packages_underinpython_crawler.rsreads<venv>/Lib/site-packageson Windows). Thefixtures were not. In the discovery test,
svctherefore had no installdirectory of its own, and the scan had nothing to name as not scanned.
The second test was found by the code review of this diff: same wrong
assumption, but it hid a missing guard instead of failing.
Evidence
cargo test -p socket-patch-cli --test scan scan_project_discovery10 passed;
cargo test -p socket-patch-cli --test in_process_scan scan_ignores_ambient_virtual_env1 passed. The Unix path of both fixtures is unchanged.
main'sscheduled runs. The green side is a
workflow_dispatchCI run withos=windowson this branch (run 44711932605, head 9caa51b):agent_scan_names_a_python_project_below_with_its_own_venv ... okintest (windows-latest, 2)andscan_ignores_ambient_virtual_env ... okin
test (windows-latest, 1). Thescantest binary, which failed onmain(237 passed; 1 failed), has no failure left.rustfmt --checkon both files is clean, andcargo clippy --locked -p socket-patch-cli --all-features -- -D warnings(CI's form) is clean.
/code-review high: no finding in the diff; its one pre-existingfinding (the second test) is fixed here.
Notes
The two Windows shards of that dispatch run are still red, on tests
that fail the same way in
main's scheduled run of 2026-11-20 (head6579162) and that this PR does not touch:
gem_refresh::tests::an_unwind_names_no_rerun_for_a_shared_home(shard 1): the expected text joins paths with
/, the product withthe platform separator.
e2e_gem_native_ext_build(the Java gem cases) and 2 ofget_update_summary_e2e(shard 2).They are not required checks;
ci-okandclippyare green. I foundno open issue for them.
cargo clippy -p socket-patch-cli --all-targets --all-features -- -D warningsreports errors in test support modules on
maintoo (for example"file is loaded as a module multiple times" under
tests/common).None is in a file this PR touches, and CI's clippy job does not use
--all-targets. Not changed here.https://claude.ai/code/session_011f9aeRBdeH3QaHTL2ZTJ4H
Generated by Claude Code