Repository navigation
Commit b9846fe
authored
test(release): clean up the guard test's scratch dir without an EXIT trap (#3673)
## 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.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **Tests**
- Improved cleanup of temporary test files after release-freeze
validation.
- Preserved existing validation of release-freeze guard behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
335 | | - | |
336 | 334 | | |
337 | 335 | | |
338 | 336 | | |
| |||
370 | 368 | | |
371 | 369 | | |
372 | 370 | | |
| 371 | + | |
| 372 | + | |
373 | 373 | | |
0 commit comments