Skip to content

test(release): clean up the guard test's scratch dir without an EXIT trap - #3673

Merged
Aleksei Sviridkin (lexfrei) merged 1 commit into
mainfrom
fix/release-freeze-trap-declared
Aug 8, 2026
Merged

test(release): clean up the guard test's scratch dir without an EXIT trap#3673
Aleksei Sviridkin (lexfrei) merged 1 commit into
mainfrom
fix/release-freeze-trap-declared

Conversation

@lexfrei

@lexfrei Aleksei Sviridkin (lexfrei) commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

What this PR does

make unit-tests fails on a clean main: hack/bats-no-exit-trap.bats reports release-freeze-contract.bats as holding one EXIT trap with no declaration.

Neither change that produced this was wrong on its own. The per-file trap guard replaced a frozen global count with declarations carried by each file, and the backport guard test arrived with an EXIT trap from a branch that predated the guard. Each was green against its own base; together they are red.

The fix follows the convention the guard exists to promote rather than declaring fresh debt: the scratch directory is removed on the last line of the test body. That also preserves the behaviour the rule is for, since a failing test never reaches the cleanup and leaves its directory behind for inspection.

Testing

hack/release-freeze-contract.bats and hack/bats-no-exit-trap.bats both pass on this branch.

Summary by CodeRabbit

  • Tests
    • Improved cleanup of temporary test files after release-freeze validation.
    • Preserved existing validation of release-freeze guard behavior.

…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 <f@lex.la>
@github-actions github-actions Bot added area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) size/XS This PR changes 0-9 lines, ignoring generated files labels Aug 8, 2026
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 86f11aed-80ed-45ec-b176-b5ebdd0c38ed

📥 Commits

Reviewing files that changed from the base of the PR and between 1b17888 and a042c2d.

📒 Files selected for processing (1)
  • hack/release-freeze-contract.bats

📝 Walkthrough

Walkthrough

The release-freeze contract test no longer uses an EXIT trap. It explicitly removes its temporary directory after validating the guard behavior.

Changes

Release-freeze test cleanup

Layer / File(s) Summary
Explicit temporary-directory cleanup
hack/release-freeze-contract.bats
The test removes the EXIT trap and explicitly deletes the temporary directory before returning.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers: myasnikovdaniil

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: cleaning up the guard test scratch directory without an EXIT trap.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/release-freeze-trap-declared

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lexfrei
Aleksei Sviridkin (lexfrei) merged commit b9846fe into main Aug 8, 2026
15 checks passed
@lexfrei
Aleksei Sviridkin (lexfrei) deleted the fix/release-freeze-trap-declared branch August 8, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) size/XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant