Skip to content

Use explicit resource management in tests#132

Merged
cpojer merged 11 commits into
nkzw-tech:mainfrom
KATT:ajohansson/080b0f2d
Jul 20, 2026
Merged

Use explicit resource management in tests#132
cpojer merged 11 commits into
nkzw-tech:mainfrom
KATT:ajohansson/080b0f2d

Conversation

@KATT

@KATT KATT commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

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
KATT marked this pull request as ready for review July 17, 2026 13:49
KATT and others added 11 commits July 20, 2026 16:29
Use `await using` and AsyncDisposable helpers so test setup/teardown is scoped explicitly instead of relying on try/finally blocks.

Co-authored-by: Cursor <[email protected]>
Remove committed empty-git-hooks directory and explicit AsyncDisposable
intersection types from test helpers; let factory return types infer instead.

Co-authored-by: Cursor <[email protected]>
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 <[email protected]>
Stop wrapping git-state withRepo in withGitTestEnvironment and remove
the walkthrough-commit hook path override tied to core.hooksPath.

Co-authored-by: Cursor <[email protected]>
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 <[email protected]>
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 <[email protected]>
Use createTemporaryDirectorySync and Symbol.dispose for env/home cleanup
so config-defaults tests stay synchronous like on main.

Co-authored-by: Cursor <[email protected]>
@cpojer
cpojer force-pushed the ajohansson/080b0f2d branch from dbde730 to 2c8875d Compare July 20, 2026 07:34
@cpojer
cpojer merged commit fc9e0b1 into nkzw-tech:main Jul 20, 2026
@cpojer

cpojer commented Jul 20, 2026

Copy link
Copy Markdown
Member

Thank you!

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.

2 participants