test(skill-install): expect the documented Hermes home on Windows - #314
Open
kaanisthatyou wants to merge 1 commit into
Open
kaanisthatyou wants to merge 1 commit into
kaanisthatyou wants to merge 1 commit into
Conversation
`cargo test --workspace` failed on native Windows in two harness tests. Both asserted the POSIX `~/.hermes` layout, but `hermes_home_for_user_home` deliberately mirrors Hermes's own convention and resolves `%LOCALAPPDATA%\hermes` on Windows, never deriving the path from `home`. `skills_dirs_match_harness_spec` now builds the expectation from a helper that mirrors the documented contract, and `detects_hermes_from_home_layout` points LOCALAPPDATA at its temp home so it exercises the resolved directory instead of creating `hermes` in the real user profile. LOCALAPPDATA is restored before the assertions run, so a failure cannot leave it pointing at a deleted temp directory for the tests that follow. Because the lib test target failed, cargo stopped there and the Windows integration tests never ran at all. The Windows CI job runs filtered test paths and none of them selected `skill_install::harness`, so add that path alongside the other `--lib` steps. Closes Tencent#312 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #312.
Problem
cargo test --workspacefails on native Windows in twoskill_install::harnesstests. Reproduced on Windows 11 (10.0.26200) atc1e5052:Both assert the POSIX
~/.hermeslayout, buthermes_home_for_user_homedeliberately mirrors Hermes's ownget_hermes_home()and resolves%LOCALAPPDATA%\hermeson Windows — it never derives the path fromhomethere. The implementation is right; the assertions did not account for the branch it documents.Every other assertion in
skills_dirs_match_harness_specsurvives on Windows because they all reduce tohome.join(".<name>")andPathequality compares components, so the separator does not matter. Hermes is the one entry that does not.Because this is the lib test target, cargo stops there and the integration tests never run.
Changes
expected_hermes_hometest helper mirrors the documented contract —%LOCALAPPDATA%\hermeson native Windows, else~/.hermes— so both tests build their expectation the same way instead of hard-coding one platform's layout.detects_hermes_from_home_layoutpointsLOCALAPPDATAat its temp home for the resolution, then creates the directory the resolver will actually look at. Creating%LOCALAPPDATA%\hermesfor real would write into the developer's profile, and clearing the variable would only move the assertion to thehome\AppData\Local\hermesfallback. The variable is restored before the assertions run, so a failing assertion cannot leave it pointing at a deleted temp directory for the tests that follow. The test already takeslock_harness_env(), so the serialisation this needs is in place.windows-daemonjob runs filtered test paths and none of them selectedskill_install::harness, which is why Windows CI never caught this. Added one step next to the other--libones.No production code changed.
Tests
cargo test -p bsk --lib skill_install::harnesson Windows 11, Rust 1.94.1:8 passed; 2 failed(the two above)10 passed; 0 failedcargo fmt --checkandcargo clippy -p bsk --lib --all-targetsare clean.cargo test --workspacenow gets past the lib target, and one integration test fails on this machine:browser_list_ordering::browser_list_and_multiple_browsers_error_share_stable_ordering, onconnect IPC named pipe ... (os error 2). That one is environmental rather than related to this change — it fails identically with my changes stashed, since it needs a daemon this machine is not running. Worth knowing that fixing the lib tests is what makes it visible at all.Unrelated observation
While verifying, every dev build left
crates/bsk-cli/skill/SKILL.mdmodified in the working tree. That iscrates/bsk-cli/build.rsdoing what it says — syncing the repo-root skill into the packaged copy — but the two committed blobs have drifted (d8c1110vs47bea20), so the copy is a real write rather than a no-op and every contributor gets a dirty tree aftercargo build. I left it out of this PR; happy to open a separate one that commits the synced copy if you'd like.