GeezerVison is showing github.com — test(shared): login-shell capture test no longer copies printenv by IzonIcy · Pull Request #40473 · pingdotgg/t3code
Conversation
Problem
readEnvironmentFromLoginShell's profile-replaces-PATH test copies the host's printenv into a temporary prefix to simulate a machine whose login shell has no printenv on PATH. On macOS /usr/bin/printenv is a shared-cache stub, so the copy cannot execute: it is killed with SIGKILL, every capture comes back empty, and the test fails on every run.
$ vp test run packages/shared/src/shell.test.ts -t "captures values when the profile replaces PATH"
× captures values when the profile replaces PATH and a DEBUG trap echoes commands
→ expected {} to deeply equal { Object (PATH) }
Tests 1 failed | 79 skipped (80)
$ cp /usr/bin/printenv /tmp/printenv && /tmp/printenv PATH
Killed: 9
Expected: the test passes on macOS, like it does on the Linux runners that run it in CI. Actual: packages/shared is red on a clean macOS checkout for every contributor, and Linux-only CI cannot see it.
Change
Write a two-line #!/bin/sh shim named printenv in the private prefix instead of copying the system binary. The capture only needs the value of the named variable, which the shim reads from the environment. The assertions and the simulated host are unchanged.
Scope and approval
Test-only fix for an obvious defect, so it needs no prior discussion: no product behavior changes, one test, and the failing assertion is the defect. It is not a skipped or weakened test; the same assertions run, and the test still fails when the behavior it covers regresses.
Verification
vp test run packages/shared/src/shell.test.ts → 80 tests, 77 passed, 3 skipped (before: 1 failed / 76 passed).
vp test run packages/shared/src → 108 files, 1892 passed, 5 skipped.
vp lint packages/shared/src/shell.test.ts → 0 warnings, 0 errors.
vp run --filter @t3tools/shared typecheck → 0 errors.
- Mutation check: reverting the shim and empty-ing the inherited
PATH argument in buildEnvironmentCaptureCommand makes the test fail again, so the test still covers the fallback it was written for.
Could not check: the CI-only Linux path, which is unchanged in behavior (/bin/sh reads the same variable the copied binary did).
DeepSeek V4.1 Flash via Capy
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chatgpt-codex-connector[bot] reacted with thumbs up emoji
The test copied /usr/bin/printenv into a private prefix to stand in for a
host whose login shell lacks it. On macOS that binary is a shared-cache
stub, and the copy dies with SIGKILL, so every capture comes back empty
and the test fails on every run there. A two-line shell shim reads the
same variable from the environment and runs anywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-11-21T18:36:22.889630Z |
e4309b6 |
PR opened |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
The Bash login-shell test now creates a private printenv script instead of copying the host executable. Its comment describes a non-FHS host where only the private prefix contains printenv.
Changes: Bash login-shell test
| Layer / File(s) |
Summary |
Private printenv test setup packages/shared/src/shell.test.ts |
The test writes an executable printenv script in the temporary tools directory. The comment describes a non-FHS host where only the private prefix contains printenv. |
Estimated code review effort: 1 (Trivial) | ~3 minutes
Change: Other
Suggested reviewers: lucenx9, macroscopeapp
Merge Risk: Minimal · up to e4309
-
This change only makes a shell environment test work on macOS by using a simple script in place of a copied system binary. It does not alter production behavior, and merge risk is minimal.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title "test(shared): login-shell capture test no longer copies printenv" directly describes the main change: the login-shell capture test now creates a shim instead of copying the host printenv bi… |
| Description check |
 |
The description follows the template sections: Problem, Change, Scope, and Verification. The Problem section explains the macOS SIGKILL failure and reproduction steps. The Change section explains the … |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title "test(shared): login-shell capture test no longer copies printenv" directly describes the main change: the login-shell capture test now creates a shim instead of copying the host printenv binary. It is specific, follows the conventional commit style used by the repository template, and matches the raw summary and objectives.
Full details: Description check
-
Explanation
The description follows the template sections: Problem, Change, Scope, and Verification. The Problem section explains the macOS SIGKILL failure and reproduction steps. The Change section explains the two-line #!/bin/sh shim. The Scope section explains why no prior issue is linked and states that the change is test-only. The Verification section lists focused and repo-wide test, lint, and typecheck results, plus a mutation check and an unchecked Linux CI path. The description states the model used at the end, as the template asks. The Scope section gives a reason for omitting a linked issue, which the template permits for small obvious fixes. Overall the description is mostly complete.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 194025e and e4309b6.
Files selected for processing: 1
-
packages/shared/src/shell.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:S
10-29 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|