Skip to content

fix(tests): skip symlink tests when symlink creation is unprivileged - #921

Open
MohammedAlkindi wants to merge 1 commit into
aws:developfrom
MohammedAlkindi:fix/windows-symlink-test-skip
Open

MohammedAlkindi wants to merge 1 commit into
aws:developfrom
MohammedAlkindi:fix/windows-symlink-test-skip

Conversation

@MohammedAlkindi

Copy link
Copy Markdown

Issue #, if available: none filed.

Description of changes

os.symlink needs Administrator rights or Developer Mode on Windows, and Developer Mode is off by default. Five functional tests call it unguarded, so a Windows contributor running the documented make pr gets OSError: [WinError 1314] on a change unrelated to symlinks. CI misses it because GitHub's windows-latest runners are elevated.

Adds a symlinks_supported() probe to tests/testing_utils.py and gates those five with skipUnless, mirroring the Windows-awareness already in read_link_without_junction_prefix. Test-only, no production code touched.

Description of how you validated changes

Windows 11, Developer Mode off, Python 3.14. Before: all five fail, four directly on os.symlink with WinError 1314, and test_link_directory on an islink() assertion after the production fallback copies instead. After: the same five skip with a reason. tests/unit 831 passed either way, and black --check is clean on the three files.

Six test_cli.py failures appear both before and after on my machine, unrelated to this change (a local subprocess WinError 2), so the failing set is otherwise identical.

Checklist

  • Review the generative AI contribution guidelines

os.symlink needs Administrator rights or Developer Mode on Windows, and Developer Mode is off by default. Five functional tests called it unguarded, so a local Windows contributor running make pr saw WinError 1314 rather than a clean run. Probe the capability in tests/testing_utils.py and skipUnless on it, matching the Windows-awareness already in read_link_without_junction_prefix.
@MohammedAlkindi
MohammedAlkindi requested a review from a team as a code owner September 14, 2026 12:10
@github-actions github-actions Bot added pr/external stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr/external stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant