Repository navigation
Skip the symlink guardrail tests when the platform refuses a symlink - #12
Closed
simin-yuan wants to merge 1 commit into
Closed
simin-yuan wants to merge 1 commit into
simin-yuan wants to merge 1 commit into
Conversation
…symlink os.symlink raises OSError (WinError 1314) on Windows unless the account holds SeCreateSymbolicLinkPrivilege, so the two symlink tests in tests/test_guardrails.py errored instead of running. They now skip with the reason when creation is refused, and still run wherever symlinks are permitted.
simin-yuan
force-pushed
the
fix/windows-symlink-tests
branch
from
October 28, 2026 16:02
81d0a4c to
a433151
Compare
Neboy72
added a commit
that referenced
this pull request
Oct 31, 2026
… link Windows raises OSError (WinError 1314) from os.symlink unless the account holds SeCreateSymbolicLinkPrivilege, so both symlink tests errored during setup instead of testing anything. The new _link_or_skip helper creates the link and skips the test with the reason when creation is actually refused, so the tests still run where symlinks are permitted. The suite now also runs on windows-latest. Until now it ran on ubuntu-latest only, which is why this went unnoticed: a red Windows checkout looked like a broken project rather than a gap in our CI. Patch and tests by Simin Yuan (PR #12).
Owner
|
Your patch is on main and credited in the changelog: the two symlink tests in tests/test_guardrails.py skip with the reason where the platform refuses to create a link, and still run wherever symlinks are permitted. It is part of v0.22.44, released today: https://github.com/Neboy72/nexus-memory/releases/tag/v0.22.44 Thank you, closing as merged by hand. |
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.
What this changes
tests/test_guardrails.pynow creates its symlinks through a small helper that skips the testwith the reason when the platform refuses to create a symlink, instead of letting the error fail
the test.
Why
On Windows,
os.symlinkraisesOSError(WinError 1314, "a required privilege is not held bythe client") unless the account holds
SeCreateSymbolicLinkPrivilege— developer mode or anelevated shell. Both symlink tests were therefore erroring during setup rather than testing
anything:
The skip is decided by attempting the call and catching
OSError/NotImplementedError, not bythe platform name, so the tests still run on Windows wherever symlinks are permitted, and are
never skipped on macOS or Linux.
Test evidence
Windows 11, Python 3.11.16,
pytest tests/test_guardrails.py -rs:Both entries are the two symlink tests; nothing else changes state in them.
pytest tests/test_guardrails_linear.py→ 30 passed, unchanged. No source files are touched, so no pinchange is involved.
Scope
Scope: the two symlink tests only. Files touched:
tests/test_guardrails.pyand aCHANGELOG.mdentry under[Unreleased]. Nothing insrc/, so no pin change is involved.I license this contribution under the MIT licence of this project.