Repository navigation
test(windows): write the materialize fixtures with LF, skip the symlink case - #23788
Conversation
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5, fork) — ⏭️ skippedRevision |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns. This is a test-only change: the fixtures now write the exact bytes the tests assert, and the symlink case uses the same shared [DESIGN-REVIEWED] fca6ca8 Description read[DESCRIPTION-READ] 6b30fdb6632d7960566fdb4495d80fe3351c9cc786b94e48c08410d55baa6e3e That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
|
CI on
A fork cannot re-run workflows. Could a maintainer re-run CI run 40113560393? The same 17:01–17:02 stall cancelled Fast Gate on #23781. |
…nk case Two of the three test_artifact_materialize strict xfails create no symlink at all: they write a fixture with write_text, which on Windows turns "\n" into "\r\n", and then compare the bytes the code read with the LF the test meant. Write the fixtures with newline="\n" (and bytes where the test compares bytes). The third really does need a symlink, so it takes requires_symlinks, as its refused-case sibling already does, instead of a list line. Drop the three lines and the comment above them, which named copytree, a call none of the three makes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
86a2fd5 to
fca6ca8
Compare
Security Scope Review (fork) — 🔴 BLOCK (blocking)Which legitimate operations does no leg reported, and this was not the nothing-to-adjudicate short circuit No |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: test (2 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: Windows test fixtures write LF bytes and skip the symlink case without privilege; removes three now-passing entries from the Windows expected-failures list.
Problem / Motivation
Goal: the three artifact-materialize tests listed as Windows xfails run on the Windows matrix: the two that need no symlink pass, and the one that does skips only where symlinks cannot be made.
The three
test/test_artifact_materialize.pyentries intest/windows-expected-failures.txtsit under a comment saying they need symlink-creation privilege because they "exercise copytree's handling of in-tree POSIX symlinks". None of them calls copytree, and two create no symlink. On a Windows host:test_materialize_recorded_document_succeeds:assert '# hello\r\n' == '# hello\n'test_safe_read_with_identity_authorized:assert b'# ok\r\n' == b'# ok\n'test_materialize_symlinked_request_resolves_to_recorded_inode:OSError: [WinError 1314]on a host without the privilegeThe first two write their fixture with
Path.write_text, which on Windows turns\ninto\r\n, and then compare the bytes the code read with the LF the test meant.Why it matters
The materialize path decides which recorded document an artifact may read, by inode identity. As strict xfails, its success path and the identity-checked byte read assert nothing on Windows.
Not a goal
_materialize_and_pinorsafe_read_file_bytes_with_identityread a file; both return exactly the bytes on disk.What changed (motivation → approach → change)
test/test_artifact_materialize.py:_write_docwritesencoding="utf-8", newline="\n", and the identity read's fixture iswrite_bytes(b"# ok\n"), so the file holds what the test asserts on every platform.test_materialize_symlinked_request_resolves_to_recorded_inodetakes@requires_symlinks, the rootdir marker its refused-case siblingtest_materialize_symlink_to_unrecorded_file_refusedalready carries. Where symlinks can be made it runs, now against an LF fixture, and elsewhere it skips with the marker's reason.test/windows-expected-failures.txt.Backwards compatibility
Compatible: test-only; no product code changes. On POSIX the fixtures hold the same bytes they did.
Removes nothing: three strict-xfail lines go; one test that needs a symlink now skips by the shared marker where none can be made, as its sibling does, and no assertion is dropped.
Tests
test/test_artifact_materialize.pyandtest/test_windows_gap_list.pyon a Windows host without symlink privilege: 27 passed, 2 skipped (the two@requires_symlinkstests), on Python 3.13.5 and on 3.12.13.check_comment_historypass. A trial merge with my other open list edits (test(windows): burn down six path-separator xfails #23777, test(windows): burn down the gateway-run xfails by patching the rlimit seam #23781, test(windows): pin USERPROFILE in the two subagent cwd tilde tests #23786) and with test: decode repository files as utf-8 in tests that read them as text #23775 is clean.Proof: not provable -- test-only change
Manual verification
N/A — test-only change; the Windows run above is the check, and the Windows matrix runs these tests on this PR, including the symlink case where the runner can make one.
Related Issues
Fixes #23787
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
🤖 Generated with Claude Code