Skip to content

test: skip alias-collision test when symlink creation is unavailable - #10410

Merged
isaacbmiller merged 1 commit into
stanfordnlp:mainfrom
iam-kira:test/skip-symlink-alias-test-without-privilege
Sep 16, 2026
Merged

isaacbmiller merged 1 commit into
stanfordnlp:mainfrom
iam-kira:test/skip-symlink-alias-test-without-privilege

Conversation

@iam-kira

Copy link
Copy Markdown
Contributor

tests/primitives/test_python_interpreter.py::test_rejects_alias_basename_colliding_with_another_file calls alias.symlink_to(first) unconditionally, which raises OSError (WinError 1314) on unprivileged Windows (no elevation, Developer Mode off) and errors the test in setup.

The same file already guards the identical call in test_symlinked_path_resolution (the try/except (OSError, NotImplementedError) → pytest.skip block). This applies that existing pattern to the one spot that was missing it.

Behaviour is unchanged wherever symlinks are available.

(Reviewed line-by-line; AI-assisted — the commit carries a Co-Authored-By trailer.)

The diff (already committed on the branch):

 second.parent.mkdir()
 alias.parent.mkdir()
  • alias.symlink_to(first)
  • try:
  •    alias.symlink_to(first)
    
  • except (OSError, NotImplementedError) as exc:
  •    pytest.skip(f"symlink creation unavailable: {exc}")
    

alias.symlink_to() raises OSError (WinError 1314) on unprivileged Windows, erroring this test in setup. Mirror the guard already used at test_symlinked_path_resolution in the same file.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@greptile-apps

greptile-apps Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

Safe to merge: the test retains its assertion on supported platforms and handles unavailable symlink creation as intended.

What we checked:

  • Performed the general-contract-validation-proof for the alias-basename collision scenario by capturing a before-log and an after-log. T-Rex
  • Executed the alias-basename-collision-commit-comparison.py harness and generated the source-output log to validate the differences between the two captures. T-Rex
  • Reviewed the harness output to confirm consistency with the captured logs and documented the validation steps. T-Rex
  • Collected four artifacts to support the proof, including two logs, the harness script, and the source-output log. T-Rex

Summary

The alias-basename collision test now skips when symlink creation is unavailable. Its existing collision assertion still passes on systems that support symlinks, and forced OSError and NotImplementedError symlink failures reach the new skip path. Safe to merge.

Reviews (1) · Last reviewed commit: "test: skip alias-collision test when sym..."

@iam-kira

Copy link
Copy Markdown
Contributor Author

tests/primitives/test_python_interpreter.py::test_rejects_alias_basename_colliding_with_another_file calls alias.symlink_to(first) unconditionally, which raises OSError (WinError 1314) on unprivileged Windows (no elevation, Developer Mode off) and errors the test in setup.

The same file already guards the identical call in test_symlinked_path_resolution (the try/except (OSError, NotImplementedError) → pytest.skip block). This applies that existing pattern to the one spot that was missing it.

Behaviour is unchanged wherever symlinks are available.

(Reviewed line-by-line; AI-assisted — the commit carries a Co-Authored-By trailer.)

The diff (already committed on the branch):

 second.parent.mkdir()
 alias.parent.mkdir()
  • alias.symlink_to(first)
  • try:
  •    alias.symlink_to(first)
    
  • except (OSError, NotImplementedError) as exc:
  •    pytest.skip(f"symlink creation unavailable: {exc}")
    

@isaacbmiller

Copy link
Copy Markdown
Collaborator

lgtm. Thanks for the pr!

@isaacbmiller
isaacbmiller merged commit 24985f8 into stanfordnlp:main Sep 16, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants