Skip to content

isolate editor env in reword CLI tests#13023

Merged
Byron merged 1 commit intogitbutlerapp:masterfrom
Byron:fix-test-isolation
Mar 25, 2026
Merged

isolate editor env in reword CLI tests#13023
Byron merged 1 commit intogitbutlerapp:masterfrom
Byron:fix-test-isolation

Conversation

@Byron
Copy link
Copy Markdown
Collaborator

@Byron Byron commented Mar 24, 2026

Clear inherited GIT_EDITOR, VISUAL, and EDITOR in the shared test harness so CLI tests don't pick up the developer's shell settings.

Othewise the test may fail as it tries to open the user editor under GIT_EDITOR which takes precedence.

Clear inherited GIT_EDITOR, VISUAL, and EDITOR in the shared test
harness so CLI tests don't pick up the developer's shell settings.

Othewise the test may fail as it tries to open the user editor
under GIT_EDITOR which takes precedence.

Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
Copilot AI review requested due to automatic review settings March 24, 2026 23:06
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 24, 2026

@codex is attempting to deploy a commit to the GitButler Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the but CLI test harness more hermetic by clearing inherited editor-related environment variables so tests don’t accidentally launch the developer’s configured editor.

Changes:

  • Remove GIT_EDITOR, VISUAL, and EDITOR from the shared command environment isolation used by CLI tests.
  • Update the reword branch test to set GIT_EDITOR explicitly (matching Git’s precedence rules).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
crates/but/tests/but/command/reword.rs Sets GIT_EDITOR in the test invocation so the harness-controlled editor script is always used.
crates/but-testsupport/src/prepare_cmd_env.rs Extends environment isolation to remove editor env vars that can cause flaky or hanging tests.

@Byron Byron merged commit 7da2ec2 into gitbutlerapp:master Mar 25, 2026
38 of 39 checks passed
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.

3 participants