Skip to content

Use explicit resource management in tests#132

Open
KATT wants to merge 10 commits into
nkzw-tech:mainfrom
KATT:ajohansson/080b0f2d
Open

Use explicit resource management in tests#132
KATT wants to merge 10 commits into
nkzw-tech:mainfrom
KATT:ajohansson/080b0f2d

Conversation

@KATT

@KATT KATT commented Jul 17, 2026

Copy link
Copy Markdown

Summary

awtr0v

No functional changes as far as I can tell

Test plan

  • pnpm exec vp check --fix
  • pnpm exec vpr build
  • pnpm exec vp test — 627/627 passed
  • Verified zero finally { blocks remain under core/__tests__ and electron/__tests__

KATT and others added 10 commits July 17, 2026 14:07
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
KATT marked this pull request as ready for review July 17, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant