Skip to content

refactor(test): give the hash-named black-box tests descriptive names - #451

Merged
oxr463 merged 3 commits into
masterfrom
rename-tests-164
Oct 2, 2026
Merged

oxr463 merged 3 commits into
masterfrom
rename-tests-164

Conversation

@oxr463

@oxr463 oxr463 commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Renames the 122 opaque hash-named test files in 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.
  • One linked pair, test-c6b77b77.mk/test-c6b77b77.sh, renamed together to test-make-under-proot.{mk,sh}, including the internal make -f reference inside the .sh.
  • Pure rename pass: no test logic changed, nothing deleted or merged, even where a test already had a borderline-acceptable name (careauth.sh, getresid.sh, tempdire.sh, etc.) for consistency with the rest.

Test plan

  • Clean build in gcc:13 (make -C src loader.elf loader-m32.elf build.h proot)
  • make -C test/unit check — 100%, 10/10, identical to master
  • Full Bats suite (bind.bats cwd.bats auxv.bats readlink.bats no-new-privs.bats) — 14/14 pass/skip, unchanged
  • Full black-box suite (make -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, and test-proot-tmp-dir-env, the renamed test-tempdire), nothing new

Closes #164.

https://claude.ai/code/session_016jPQ9wt6qox2XEbE71wwCW

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
@oxr463 oxr463 added this to the PRoot v5.5.0 milestone Oct 2, 2026
Comment thread test/test-faccessat-nofollow-ignored.c Fixed
oxr463 added 2 commits October 2, 2026 11:30
…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
@sonarqubecloud

sonarqubecloud Bot commented Oct 2, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
E Reliability Rating on New Code (required ≥ A)
D Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@oxr463
oxr463 merged commit 242d401 into master Oct 2, 2026
10 of 11 checks passed
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.
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.

Meaningful names for tests

2 participants