test: pin fail-soft contract for rootdir symlink probe - #6227
Conversation
Extend test_symlink_capability_probe.py to parametrize test cases over both test/conftest.py's _can_create_symlink and root conftest.py's _root_can_create_real_symlink probes. Ensures that unanticipated filesystem OSErrors, Windows privilege absence (winerror 1314 with unrelated errno), NotImplementedError, and missing symlink attributes disable symlink capability without raising an error during conftest collection. Fixes kirodotdev#5946
|
👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated. Missing sections:
Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle. |
|
@dwu96 Thanks for the heads up! I've updated the PR description with all the required sections from the PR template (Problem / Motivation, Why it matters, What changed, Tests, and checklist). |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Both probes in the base already catch Design-Verdict: PASS Pins a real, previously-unpinned fail-soft contract on the rootdir probe with a proportionate, test-only change that also fixes the old test's mislabeled target. [DESIGN-REVIEWED] a4ce33a |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed |
iamwhatever
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: test (1 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: parameterises the existing symlink-capability-probe regression tests over both the test/ and rootdir conftest probes and adds a missing-os.symlink case; single test file, no runtime code. CodeQL is not applicable on this fork PR (default-setup emits no check-run); SAST coverage is Semgrep only, latest run success with 0 annotations.
bolichen97
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: test (1 file). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: test: pin fail-soft contract for rootdir symlink probe — test-file-only change extending existing probe regression tests to both conftests. CodeQL is not applicable on this fork PR (default-setup emits no check-run); SAST coverage is Semgrep only, latest run success with 0 annotations. Note: auto-merge could not be armed from this run (agent command posture blocks gh pr merge); merge remains gated by branch protection and a maintainer.
Problem / Motivation
The symlink capability probe exists in two places with the same fail-soft contract:
_can_create_symlinkintest/conftest.py_root_can_create_real_symlinkin repo-rootconftest.pyWhile
_can_create_symlinkwas pinned in #5943 viatest/test_symlink_capability_probe.py, its rootdir sibling_root_can_create_real_symlinkremained unpinned against regression.Why it matters
Both probes run at conftest import time (
_HAS_SYMLINKSand_ROOT_HAS_REAL_SYMLINKS). If an unanticipated filesystem error (OSError, missingos.symlinkattribute, orNotImplementedError) is allowed to propagate, it results in a whole-suite collection error taking down the entire test run, rather than failing soft and skipping only the symlink-dependent tests.What changed (motivation → approach → change)
test/test_symlink_capability_probe.pyusing a fixture (symlink_probe) that parametrizes all test cases across bothtest/conftest.py's_can_create_symlinkand repo-rootconftest.py's_root_can_create_real_symlink(accessed via pytest's plugin manager).EPERM,EACCES,EOPNOTSUPP,ENOSYS)winerror == 1314with unrelated errno)OSError(e.g.EIO)NotImplementedErrorand missingos.symlinkattribute)Tests
test/test_symlink_capability_probe.pycovering 16 test permutations across both probes.pytest test/test_symlink_capability_probe.py— all 16 tests passed.Manual verification
N/A — unit test coverage directly tests the probe functions and failure modes.
Related Issues
Fixes #5946
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)