Repository navigation
tests: five adopt tests skip on any failure of make_source_repo, or of the git call that makes a branch whose name is not UTF-8, so a full disk or a refused write reads as SKIPPED #853
Description
Goal: every test that needs a directory, or a branch, named with a byte that is not UTF-8 asks the system once whether it can carry the name and lets a failure of the git call that follows fail the test, so a full disk or a refused write reads as a failure and not as SKIPPED.
Filed by lane openRepoShape-5, from the checklist candidates of #834's PR (#845, writer w834, "Left out, and checklist candidates", both bullets). Tests only. Both lines are read from source, not measured: each needs a git call that fails for a reason other than the name, and none was run here. What was measured here is the set of places: an AST scan of tests/*.py on main for an except that names AssertionError and holds a pytest.skip finds exactly the five below and no other.
Lands after: lane 5's #757 (PR #806, fix/757-non-utf8-test-dirs, head 76ae6419), which puts skip_where_a_name_cannot_be_not_utf_8 in front of the three tests of the first line and keeps their second skip on purpose (its body: "Each test keeps its own second skip: git will not work under <name> in the three adopt tests"), and #834 (PR #845, fix/834-oserror-skips, head efb17273, stacked on #806), which does the same for five other sites and names these as left out. At that head refused_then_moved takes skip_where_git_fails, and the U+202E test passes false (lane 4's review, SHOULD 2), so of its two callers only the test of a name that is not UTF-8 keeps the second skip. The second line also waits for #797 (PR #830, fix/797-adopt-default-branch-refs, head c2bd75ce), which rewrites with_default_branch. The helper is on main (tests/conftest.py:1108, from #723); #806, #845 and #830 are not. path:line below is at main fc867207.
Lines
- Three tests skip on any
AssertionErrorofmake_source_repo. Read from source, not measured.refused_then_moved(tests/test_adopt_template_values.py:255-258, called at:301and:316),test_a_utf8_clone_of_a_source_whose_path_is_not_utf8_adopts(tests/test_adopt_git_reads.py:470-473) andtest_a_source_directory_that_is_not_utf8_is_shown_spelled(tests/test_adopt_plan_escapes.py:407-410) each wrapmake_source_repo(parent / "Thing")inexcept AssertionError as exc: pytest.skip(f"git will not work under ... here: {exc}").make_source_repo(tests/conftest.py:859) runsgit initthroughgit()(:547) andgit add -Aandgit commitfor each of its three commits, and each of them asserts on a non-zero exit, which is anAssertionError; its ownmkdirandwrite_textraiseOSError, which theexceptdoes not catch, so only a git process that fails reads as SKIPPED. A disk that fills while git writes (the test'smkdirpassed, thengit init,git addorgit commithits ENOSPC), or a directory git can no longer write in, ends the test SKIPPED with "git will not work under 'caf\udce9' here". The two answers that mean "this system cannot carry the name" are asked before it (os.fsencodeon Windows and EILSEQ on macOS: the firsttryof each test, and tests: four tests,directory_namedand the file twin ask the one helper whether a name that is not UTF-8 can be made and skip on its two answers only, and three tests skip where an ASCII file name encoding cannot carry their text (#757) #806's helper in its place), and git works under any directory a system carries, so no case is known where this second skip is the system's answer. tests: four tests,directory_namedand the file twin ask the one helper whether a name that is not UTF-8 can be made and skip on its two answers only, and three tests skip where an ASCII file name encoding cannot carry their text (#757) #806 keeps it on purpose; this line asks it a question tests: four tests,directory_namedand the file twin ask the one helper whether a name that is not UTF-8 can be made and skip on its two answers only, and three tests skip where an ASCII file name encoding cannot carry their text (#757) #806 did not. Direction: drop thetry, so a failure of the git call raises. If a state is found where git cannot work under a name this system carried, narrow theexceptto that state and say which in the reason, as tests: three tests ask the helper whether a name can be made,make_fileskips on EILSEQ or aUnicodeErroronly and the U+202E directory has no guard, so a full disk or a read-onlytmp_pathfails the test, not SKIPPED (#834) #845 does formake_file(EILSEQ only, every other error raised). -
with_default_branchandmoved_to_a_branch_that_is_not_utf8skip on anyAssertionError,UnicodeErrororOSError(tests/test_adopt_git_reads.py:536-547and:564-567; four callers, at:578,:591,:604and:617). Read from source, not measured. Each makes the branch withgit switch -q -c,git branch -m,git commit,git update-refandgit symbolic-ref, and a failure of any of them reads "no branch here is named b'caf\xe9'". Only two answers are the system's: aUnicodeErrorwhereos.fsencodegives no byte for the lone surrogate (Windows: the argument cannot be carried), and git's refusal where the file system will not hold a ref file with that name (macOS: EILSEQ fromrefs/heads/caf<e9>). Both can be asked before the first git call, as the first line's tests ask for a directory. TheOSErrorclause covers only a git that cannot be started. At adopt-project.py:_default_branchreadsorigin/HEADand HEAD by full name and whole, and reads the source only at a branch of its own, so agit clone -bsource is no longergit-failedwith no remedy, and a HEAD onorigin/x, onmain<U+00A0>or beside a tagmainno longer adopts another branch's commit (#797) #830's headwith_default_branchalso takes abranchargument and is called with a UTF-8 name (NBSP_BRANCH,mainand U+00A0, at:692), where no system refuses the name and every skip is a masked failure. Direction: for a name that is not UTF-8, callskip_where_a_name_cannot_be_not_utf_8(source.parent)before the git calls (it asksos.fsencode, then makes and removes a directory on the file system the ref file will be on) and drop theexcept; for a UTF-8 name, ask nothing. Keep the skip aftergit symbolic-ref(:550-551): whether git gives the name back as it was written is the system's answer, and no exception is behind it. A model istests/test_bootstrap_branch_bytes.py:359-360on main (the helper, then the code under test, unguarded).
Not here: make_file, the U+202E directory and the other OSError skips are #834's own lines. The skip after git symbolic-ref stays, as said above.
Verify: tests/test_adopt_template_values.py, tests/test_adopt_git_reads.py, tests/test_adopt_plan_escapes.py, tests/test_non_utf8_name_helpers.py and tests/test_repo_hygiene.py pass on Linux. For each line, one test under monkeypatch.setattr that makes make_source_repo (first line) or the module's git (second line) raise AssertionError("... No space left on device") and asserts that the caller FAILS and does not skip, as tests/test_non_utf8_oserror_sites.py (new in #845) does for the five sites it moves; the states the helper answers (EILSEQ on the probe, and os.fsencode of Windows through windows_fsencode) still skip. One mutant per line (the except put back), each caught. A test beside tests/test_repo_hygiene.py that fails an except naming AssertionError and holding pytest.skip anywhere in tests/, read as the AST scan above reads it. No Windows or macOS run: CI is Linux only (#597), so the Windows half is emulated.
Overlaps. #806 and #845 (stacked on it) edit tests/test_adopt_template_values.py, tests/test_adopt_plan_escapes.py and tests/test_adopt_git_reads.py beside these sites (the first try of each test), so this lands after both. #830 (fix/797-adopt-default-branch-refs) edits with_default_branch itself (:529-557 at its head) and tests/test_adopt_git_reads.py:625 and :692: read its head before the second line. #818 (fix/758-git-command-scope) and #848 edit tests/test_adopt_git_reads.py (command_scope, :99-118 on main) and conflict with #806 and #845 in that file already. No pinned file changes.
Parent: #461.
Milestone: v1.1.1. Tests only, nothing a user runs changes, and no test fails today: a full disk reads as SKIPPED, and CI never has one.
🤖 Generated with Claude Code
Activity
brettheap commentedon Oct 18, 2026
CLAIMED — lane openRepoShape-5, session 50cede29-ab82-4ca3-9f67-d98e1a58c8d2@Eagle, 2026-10-18T02:17:35Z, for #853
Logged in
lanes/log/openRepoShape-5.mdate0525678178c738f0e8c93ccf4f683076db67923.The three reads (lane-collision-protocol Rule 1):
brettheap commentedon Oct 18, 2026
RELEASED — lane openRepoShape-5, session 50cede29-ab82-4ca3-9f67-d98e1a58c8d2@Eagle, 2026-10-18T02:20:34Z, for #853 — nothing authored; named for lane 3 with #854, which edits the same tests (#473 issuecomment-6244650070)
brettheap commentedon Oct 18, 2026
CLAIMED — lane openRepoShape-3, session b30e8b49-f249-4668-adb1-1dbfa93c09e1@Eagle, 2026-10-18T02:22:54Z, for #853
Logged in
lanes/log/openRepoShape-3.mdat60c9edc6e63a27c1231b305db9e770d675f9848c.The three reads (lane-collision-protocol Rule 1):
tests: the three tests of the byte directory have Windows rows that h…
tests: windows_fsencode takes a path as os.fsencode does, and six row…
docs/release-notes/v1.1.1.md: the v1.1.1 notes take RV883's NIT list …
docs/release-notes/v1.1.1.md: the v1.1.1 notes take RV883's round 3 a…
docs/release-notes/v1.1.1.md: the v1.1.1 notes run to main a249910, w…
tests: six skips on a failed git call ask the system first, so a fail…
docs/release-notes/v1.1.1.md: the v1.1.1 notes run to main 0d5d2b1, w…