Use explicit resource management in tests#132
Open
KATT wants to merge 10 commits into
Open
Conversation
Use `await using` and AsyncDisposable helpers so test setup/teardown is scoped explicitly instead of relying on try/finally blocks. Co-authored-by: Cursor <cursoragent@cursor.com>
Remove committed empty-git-hooks directory and explicit AsyncDisposable intersection types from test helpers; let factory return types infer instead. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep GIT_CONFIG_COUNT at 3 and restore the original key filtering in withGitTestEnvironment while still using await using for env cleanup. Co-authored-by: Cursor <cursoragent@cursor.com>
Stop wrapping git-state withRepo in withGitTestEnvironment and remove the walkthrough-commit hook path override tied to core.hooksPath. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Point core.hooksPath at an empty temp dir so global prepare-commit-msg hooks do not pollute commit assertions, scope git-state withRepo env for readWorkingTreeState, and override hooks to the repo for the walkthrough hook streaming test. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep GIT_CONFIG_COUNT at 3 in the base helper and apply core.hooksPath only via getGitTestEnvironmentForSubprocess for subprocess git calls and withGitTestEnvironment scoping. Co-authored-by: Cursor <cursoragent@cursor.com>
Use createTemporaryDirectorySync and Symbol.dispose for env/home cleanup so config-defaults tests stay synchronous like on main. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
KATT
marked this pull request as ready for review
July 17, 2026 13:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
No functional changes as far as I can tell
Test plan
pnpm exec vp check --fixpnpm exec vpr buildpnpm exec vp test— 627/627 passedfinally {blocks remain undercore/__tests__andelectron/__tests__