Summary
Add a small withRepoFixture or usingRepoFixture helper that builds a fixture, passes it to a callback, and always calls cleanup() in a finally block.
The current fixture handle exposes explicit cleanup and cleans failed builds. That is correct, but test authors still need to remember try/finally for successful builds.
Why
Canonical fixture usage should be hard to leak. As more suites migrate under #316, an auto-cleanup wrapper will keep tests concise and reduce temp-directory leaks in failure cases.
Scope
- Add a wrapper helper for callback-style fixture usage.
- Preserve direct
build() access for tests that need manual lifetime control.
- Add regression tests proving cleanup runs when the callback throws.
- Document the recommended pattern in the repo fixture strategy.
Acceptance Criteria
- Tests can use a single helper call to build and clean a fixture.
- Cleanup runs on callback success and failure.
- Existing explicit cleanup behavior remains available.
Related
Summary
Add a small
withRepoFixtureorusingRepoFixturehelper that builds a fixture, passes it to a callback, and always callscleanup()in afinallyblock.The current fixture handle exposes explicit cleanup and cleans failed builds. That is correct, but test authors still need to remember
try/finallyfor successful builds.Why
Canonical fixture usage should be hard to leak. As more suites migrate under #316, an auto-cleanup wrapper will keep tests concise and reduce temp-directory leaks in failure cases.
Scope
build()access for tests that need manual lifetime control.Acceptance Criteria
Related