From a042c2d66f8abf5ee01ae91a5e091c6178cac1c2 Mon Sep 17 00:00:00 2001 From: Aleksei Sviridkin Date: Sat, 8 Aug 2026 21:02:20 +0300 Subject: [PATCH] test(release): clean up the guard test's scratch dir without an EXIT trap The freeze-contract suite gained a test that shelves its scratch directory with an EXIT trap. The per-file trap guard added since then reports the file as holding an undeclared trap, so the aggregate unit target fails on a clean tree. Cleaning up on the last line of the test body is what the rest of the converted suites do, and it keeps the failure behaviour the guard exists for: a test that fails leaves its scratch directory behind for inspection, because the cleanup is never reached. Signed-off-by: Aleksei Sviridkin --- hack/release-freeze-contract.bats | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/release-freeze-contract.bats b/hack/release-freeze-contract.bats index dcac7aa6f..283928d6b 100644 --- a/hack/release-freeze-contract.bats +++ b/hack/release-freeze-contract.bats @@ -331,8 +331,6 @@ step_line() { @test "the guard's merged decision is correct on empty, closed-unmerged and closed-merged lists" { command -v node >/dev/null || { echo "node unavailable; skipping"; return 0; } tmp="$(mktemp -d)" - # shellcheck disable=SC2064 - trap "rm -rf '$tmp'" EXIT cat > "$tmp/guard.js" <<'JS' function alreadyMerged(prs) { @@ -370,4 +368,6 @@ closed-merged=true" [ -n "$block" ] printf '%s\n' "$block" | script_lines | grep -qF 'prs.some(p => p.merged_at !== null)' || { echo "backport.yaml's guard no longer uses prs.some(p => p.merged_at !== null)." >&2; exit 1; } + + rm -rf "$tmp" }