fix: reap temp dirs — a runtime clone leak in resolveCheckout, and 68 uncleaned test sites #120

Merged
dan-claude-bot merged 2 commits from fix/test-tmpdir-leak into main 2026-07-21 13:21:59 +00:00
Showing only changes of commit 5075310336 - Show all commits

View file

@ -410,7 +410,7 @@ describe("changelog-monotonic.sh — release headings are append-only (#133)", (
* whose CHANGELOG.md is `head` (unchanged when omitted). * whose CHANGELOG.md is `head` (unchanged when omitted).
*/ */
function repoWith(head?: string): string { function repoWith(head?: string): string {
const repo = mkdtempSync(join(tmpdir(), "cast-monotonic-")); const repo = tmp("cast-monotonic-");
git(repo, "init", "-q"); git(repo, "init", "-q");
git(repo, "config", "user.email", "test@example.com"); git(repo, "config", "user.email", "test@example.com");
git(repo, "config", "user.name", "test"); git(repo, "config", "user.name", "test");
@ -563,7 +563,7 @@ describe("changelog-monotonic.sh — release headings are append-only (#133)", (
* `exit 0` before uniqueness had run (#133, box#143). * `exit 0` before uniqueness had run (#133, box#143).
*/ */
function repoIntroducing(head: string): string { function repoIntroducing(head: string): string {
const repo = mkdtempSync(join(tmpdir(), "cast-monotonic-new-")); const repo = tmp("cast-monotonic-new-");
git(repo, "init", "-q"); git(repo, "init", "-q");
git(repo, "config", "user.email", "test@example.com"); git(repo, "config", "user.email", "test@example.com");
git(repo, "config", "user.name", "test"); git(repo, "config", "user.name", "test");
@ -627,7 +627,7 @@ describe("changelog-monotonic.sh — release headings are append-only (#133)", (
it("a duplicate OUTSIDE a git work tree is caught (#133)", async () => { it("a duplicate OUTSIDE a git work tree is caught (#133)", async () => {
// No git at all — a tarball, an unpacked release. Uniqueness still has // No git at all — a tarball, an unpacked release. Uniqueness still has
// everything it needs; only containment does not. // everything it needs; only containment does not.
const dir = mkdtempSync(join(tmpdir(), "cast-monotonic-nogit-")); const dir = tmp("cast-monotonic-nogit-");
writeFileSync( writeFileSync(
join(dir, "CHANGELOG.md"), join(dir, "CHANGELOG.md"),
`# Changelog\n\n${dated("0.1.1")}${body}\n${dated("0.1.1")}${body}`, `# Changelog\n\n${dated("0.1.1")}${body}\n${dated("0.1.1")}${body}`,