Repository navigation
refactor(test): give the hash-named black-box tests descriptive names - #451
Merged
Merged
Conversation
60% of test/ used opaque hash names like test-5bed7141.c, making it impossible to tell what a test covers without opening it. Renamed the 122 affected files (test/GNUmakefile's wildcard-driven pattern rules pick up the new names automatically; only the hardcoded special-case rules needed updating), verified the full suite still produces the same pass/fail/skip results. Closes #164. Claude-Session: https://claude.ai/code/session_016jPQ9wt6qox2XEbE71wwCW
…rename Renaming test/test-c6b77b77.sh (formerly test-cb1143ab.sh before this branch's sweep, naming aside) and its siblings made git diff treat their new paths as changed content, so shellcheck ran on files it had never checked before and surfaced issues the diff-scoped job was built to avoid (#442). -M lets git diff tell a byte-identical rename (R100) apart from one that actually changed, so only genuinely new or modified content gets linted. Also fixes test-make-under-proot.sh's own pre-existing shellcheck issues (missing shebang, unquoted expansions), since it got a real one-line edit as part of the rename and is no longer a pure R100. Drops .gitremotes, a local scratch file that ended up staged by an earlier `git add -A`. Claude-Session: https://claude.ai/code/session_016jPQ9wt6qox2XEbE71wwCW
These three files got an unnecessary touch-up during the rename sweep, updating an embedded /tmp path template or socket name to match the new filename. mktemp(3)'s XXXXXX suffix already guarantees uniqueness, so the prefix text was cosmetic, not functional - and touching that one line was enough to make SonarCloud treat each file as new code and flag the same /tmp usage pattern this suite has used safely for years. Reverting restores all 122 renamed files to genuine pure renames. Claude-Session: https://claude.ai/code/session_016jPQ9wt6qox2XEbE71wwCW
|
oxr463
added a commit
that referenced
this pull request
Oct 2, 2026
…#451) * refactor(test): give the hash-named black-box tests descriptive names 60% of test/ used opaque hash names like test-5bed7141.c, making it impossible to tell what a test covers without opening it. Renamed the 122 affected files (test/GNUmakefile's wildcard-driven pattern rules pick up the new names automatically; only the hardcoded special-case rules needed updating), verified the full suite still produces the same pass/fail/skip results. Closes #164. * ci(shellcheck): don't re-lint a file's pre-existing issues on a pure rename Renaming test/test-c6b77b77.sh (formerly test-cb1143ab.sh before this branch's sweep, naming aside) and its siblings made git diff treat their new paths as changed content, so shellcheck ran on files it had never checked before and surfaced issues the diff-scoped job was built to avoid (#442). -M lets git diff tell a byte-identical rename (R100) apart from one that actually changed, so only genuinely new or modified content gets linted. Also fixes test-make-under-proot.sh's own pre-existing shellcheck issues (missing shebang, unquoted expansions), since it got a real one-line edit as part of the rename and is no longer a pure R100. Drops .gitremotes, a local scratch file that ended up staged by an earlier `git add -A`. * test: revert cosmetic string-literal edits in three renamed tests These three files got an unnecessary touch-up during the rename sweep, updating an embedded /tmp path template or socket name to match the new filename. mktemp(3)'s XXXXXX suffix already guarantees uniqueness, so the prefix text was cosmetic, not functional - and touching that one line was enough to make SonarCloud treat each file as new code and flag the same /tmp usage pattern this suite has used safely for years. Reverting restores all 122 renamed files to genuine pure renames.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Summary
test/(test-5bed7141.c,test-33333333.c, etc.) to names that describe what they actually test, per the checklist in Meaningful names for tests #164.test/GNUmakefile's wildcard-driven pattern rules (check-%.sh,check-%.c,.SECONDARY) pick up the new names automatically; only the ~15 hardcoded "Special cases" rules needed explicit updates.test-c6b77b77.mk/test-c6b77b77.sh, renamed together totest-make-under-proot.{mk,sh}, including the internalmake -freference inside the.sh.careauth.sh,getresid.sh,tempdire.sh, etc.) for consistency with the rest.Test plan
gcc:13(make -C src loader.elf loader-m32.elf build.h proot)make -C test/unit check— 100%, 10/10, identical to masterbind.bats cwd.bats auxv.bats readlink.bats no-new-privs.bats) — 14/14 pass/skip, unchangedmake -C test -j $(nproc)), run twice for stability — both runs fail exactly the same 6 known-flaky tests as master (test-chroot01,test-socket01/02/03,test-bug-138, andtest-proot-tmp-dir-env, the renamedtest-tempdire), nothing newCloses #164.
https://claude.ai/code/session_016jPQ9wt6qox2XEbE71wwCW