Skip to content

test(desktop): account for PATH augmentation on macOS - #9659

Open
PresentJay wants to merge 1 commit into
ParadevAI:mainfrom
PresentJay:test/macos-augmented-shell-path
Open

PresentJay wants to merge 1 commit into
ParadevAI:mainfrom
PresentJay:test/macos-augmented-shell-path

Conversation

@PresentJay

@PresentJay PresentJay commented Nov 12, 2026 •

Copy link
Copy Markdown

What & why

On macOS a login shell can omit /usr/local/sbin. The subprocess environment intentionally prepends missing Homebrew/common directories, but the integration test compared the result to the raw shell PATH. It failed on a working setup while validating #9625.

Compare the result with the shell path after its public platform-specific augmentation. Keep the existing checks for string variables and Windows Path. The separate fallback tests cover exactly which directories get added and how existing entries are handled.

How I tested it

  • macOS, Bun 1.4.3: the original assertion failed with an extra /usr/local/sbin. Including that directory in the shell environment also reproduced why this passes on some machines.
  • After the change, the complete git utility and PATH fallback test files passed: 46 tests, 83 assertions.
  • Full lint and typecheck passed (42 typecheck tasks). The default full run stopped at the separate recurrence display-format failure tracked in test(shared): compare overnight recurrence slots by timestamp #9658.

Summary by cubic

Fixes the shell environment integration test on macOS so it no longer fails on valid setups.

The test compared the process PATH to the raw shell PATH, but the subprocess intentionally prepends missing Homebrew directories on macOS. The test now applies the same platform-specific augmentation before comparing, while keeping existing checks for string variables and Windows Path.

Written for commit 31e8131. Summary will update on new commits.

View guided diff

Summary by CodeRabbit

  • Tests
    • Updated the shell environment test to account for macOS-specific PATH adjustments.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The shell environment test now applies augmentPathForMacOS to the expected PATH before comparing it with the value returned by getProcessEnvWithShellPath.

Changes: Shell PATH test

Layer / File(s) Summary
Update PATH expectation
apps/desktop/src/lib/trpc/routers/workspaces/utils/git.test.ts
The test imports augmentPathForMacOS and applies it to the expected shell PATH before comparison.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Possibly related PRs

Suggested reviewers: kitenite

Merge Risk: Minimal · up to 31e81

This is a test-only change that makes a PATH assertion account for the macOS PATH augmentation already applied in production code. It has no production behavior impact and is ready to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "test(desktop): account for PATH augmentation on macOS" follows conventional commit format and matches the changeset. The test now applies augmentPathForMacOS to the expected shell PATH befo…
Description check Passed The description covers the problem (macOS login shells can omit /usr/local/sbin, and the test compared against the raw shell PATH), the fix (compare against the augmented shell PATH while keeping the …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "test(desktop): account for PATH augmentation on macOS" follows conventional commit format and matches the changeset. The test now applies augmentPathForMacOS to the expected shell PATH before comparing it with getProcessEnvWithShellPath output, which is the main change.

Full details: Description check

Explanation

The description covers the problem (macOS login shells can omit /usr/local/sbin, and the test compared against the raw shell PATH), the fix (compare against the augmented shell PATH while keeping the string-variable and Windows Path checks), and testing details (macOS with Bun 1.4.3, 46 tests and 83 assertions passing, lint and typecheck passing, and a separate failure tracked in #9658). It does not follow the template's 'Link the issue' guidance for the related issue beyond #9625 and #9658 references, and it has no screenshots, which the template says are not needed for this test-only change. The checklist items are not marked, and the description does not state whether the PR title follows conventional commits (it does), whether maintainer edits are allowed, or CLA status. These are minor gaps relative to the template.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2550bd6a-6b4b-4728-870c-74a319a253fb
Commits

Reviewing files that changed from the base of the PR and between 9b7f8b9 and 31e8131.

Files selected for processing: 1

  • apps/desktop/src/lib/trpc/routers/workspaces/utils/git.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

This branch has not been deployed

No deployments
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