diff --git a/.gitignore b/.gitignore index 453d25c..2e23343 100644 --- a/.gitignore +++ b/.gitignore @@ -62,3 +62,6 @@ scripts/.cache/ # Locally-produced AppImage artifacts *.AppImage + +# Bats test scratch directories (created/cleaned per test) +.test-scratch/ diff --git a/tests-impl/test-check-no-upstream-edits.bats b/tests-impl/test-check-no-upstream-edits.bats index 952f661..fbd0d0a 100644 --- a/tests-impl/test-check-no-upstream-edits.bats +++ b/tests-impl/test-check-no-upstream-edits.bats @@ -19,7 +19,8 @@ teardown() { # Build a minimal disposable repo that mimics the sethLabels structure with a # local "upstream/master" ref. Returns its path via stdout. make_test_repo() { - local tmp=$(mktemp -d) + mkdir -p "$REPO_ROOT/.test-scratch" + local tmp=$(mktemp -d -p "$REPO_ROOT/.test-scratch") cd "$tmp" git init -q -b master git config user.email "test@test" diff --git a/tests-impl/test-compute-version.bats b/tests-impl/test-compute-version.bats index 7a84026..66ee346 100644 --- a/tests-impl/test-compute-version.bats +++ b/tests-impl/test-compute-version.bats @@ -47,7 +47,8 @@ setup() { @test "fails cleanly when upstream/master ref is missing" { # Run in a temp git repo with no upstream remote. - tmp=$(mktemp -d) + mkdir -p "$REPO_ROOT/.test-scratch" + tmp=$(mktemp -d -p "$REPO_ROOT/.test-scratch") cd "$tmp" git init -q git commit --allow-empty -m "init" -q