Skip to content

test(link): isolate the remote-prelude tests from a host-installed ocx - #6726

Closed
sungyongcho wants to merge 2 commits into
lidge-jun:devfrom
sungyongcho:test/link-ssh-argv-host-ocx
Closed

sungyongcho wants to merge 2 commits into
lidge-jun:devfrom
sungyongcho:test/link-ssh-argv-host-ocx

Conversation

@sungyongcho

@sungyongcho sungyongcho commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two tests in tests/clients/link-ssh-argv.test.ts fail on any host that already has ocx in /usr/bin. The OpenCodex desktop .deb is one example, because it installs /usr/bin/ocx. The failing tests are:

  • "the remote prelude appends ~/.bun/bin after the remote PATH and keeps every argument"
  • "the constructed remote command preserves POSIX argument bytes"

Both run the remote prelude with PATH=/usr/bin:/bin as the simulated remote PATH, and both expect the stub in ~/.bun/bin to run. The prelude appends ~/.bun/bin after the remote PATH on purpose, so that an ocx the remote PATH already resolves wins. A sibling test asserts exactly that. On such a host the real /usr/bin/ocx runs instead of the stub, and the tests fail. CI runners have no ocx in /usr/bin, so CI never sees this.

The two tests now use a remote PATH that holds only an sh symlink to /bin/sh. That is enough, because remoteOcxArgv runs sh -c and the stubs use #!/bin/sh. The first test's expected PATH line follows the new base. Production code and the other tests are unchanged.

I found this while running the full suite for #6722.

Verification

Run on Ubuntu 26.04 with the open-codex 2.80.0 .deb installed, where command -v ocx under PATH=/usr/bin:/bin resolves to /usr/bin/ocx:

  • bun test tests/clients/link-ssh-argv.test.ts: 16 pass / 2 fail on dev (the two tests above), 18 pass / 0 fail on this branch.
  • Regression guard: I changed REMOTE_OCX_SCRIPT to prepend the fallback directories instead of appending them, and 3 tests fail on this branch. They include the PATH-line test and "an ocx the remote PATH already resolves wins over the appended fallbacks", so the ordering contract is still enforced.
  • bun run test:changed (merge base bbab02ab27): 18 pass / 1 skip / 0 fail. The skip is the Windows-only PowerShell test.
  • After rebasing onto dev aeebf11e5a (head 8ebf15ec3f): bun test tests/clients/link-ssh-argv.test.ts passes 18 / 0 on this host, and bun run typecheck and bun run privacy:scan pass. The second commit only adds a doc comment to the fakeOcx helper, which brings CodeRabbit's docstring pre-merge check from 50% to 100%.
  • bun run typecheck, bun run structure:check, bun run privacy:scan: pass.
  • Not run on macOS. /bin/sh exists there, and these tests stay skipped on Windows as before.

Checklist

  • Scope stays focused and avoids unrelated cleanup. (One test file, two tests and one helper.)
  • Docs or release notes were updated when needed. (None needed for a test-only change.)
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. (No runtime code, credentials or workflows change.)

Summary by CodeRabbit

  • Tests
    • Updated SSH command tests to verify behavior with a restricted remote PATH.
    • Confirmed fallback directories are appended, the ~/.bun/bin stub runs, and command arguments remain intact. These checks help ensure remote SSH commands continue to find required tools and preserve arguments when the initial PATH contains only a shell.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • Required local validation passed; commands, results, and any full-suite exception are documented.

  • I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 5a3837df-1731-4057-8a0c-71605ddc44ec
📥 Commits

Reviewing files that changed from the base of the PR and between aeebf11 and 8ebf15e.

📒 Files selected for processing (1)
  • tests/clients/link-ssh-argv.test.ts

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


📝 Walkthrough

Walkthrough

The SSH argument tests use a temporary PATH containing a sh symlink. The prelude test checks that this PATH precedes appended fallback directories. The POSIX argument-preservation test also uses the controlled PATH.

Changes

SSH argument tests

Layer / File(s) Summary
Create and use a controlled PATH
tests/clients/link-ssh-argv.test.ts
A helper creates a temporary PATH containing a sh symlink. The tests use it to check the PATH prelude and preserve POSIX arguments.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 8ebf1

The change isolates the POSIX SSH argument tests from a host-installed ocx without introducing a concrete merge-blocking risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: isolating the remote-prelude tests from a host-installed ocx by using a controlled remote PATH.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · 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

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Oct 8, 2026
@sungyongcho

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions
github-actions Bot marked this pull request as ready for review October 8, 2026 01:21
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ READY

  • all PR quality gates passed; the review readiness checklist is complete.

Review readiness checklist

  • ✅ Required local validation passed; commands, results, and any full-suite exception are documented.
  • ✅ I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
  • ✅ I resolved all correct Codex and CodeRabbit findings.
  • ✅ My PR is ready for review.

✅ 4/4 boxes ticked.

This pull request is already Ready for Review.
The review-ready label marks this PR as ready; review automation runs independently.
Maintainers: @lidge-jun @Ingwannu

@sungyongcho
sungyongcho force-pushed the test/link-ssh-argv-host-ocx branch from 1a1bf8f to 8ebf15e Compare October 8, 2026 08:06
@github-actions
github-actions Bot marked this pull request as draft October 8, 2026 08:07
@sungyongcho

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@sungyongcho

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@github-actions
github-actions Bot marked this pull request as ready for review October 8, 2026 08:10
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

lidge-jun added a commit that referenced this pull request Oct 9, 2026
#6787)

* test(link): isolate the remote-prelude tests from a host-installed ocx

* test(link): document the stub ocx helper in the remote-prelude tests

Carries #6726 so it runs under repository CI.

Co-authored-by: Sungyong Cho <[email protected]>

---------

Co-authored-by: Sungyong Cho <[email protected]>
@lidge-jun

Copy link
Copy Markdown
Owner

Thank you, @sungyongcho! This change landed on dev through the maintainer carry #6787 (squash commit 2e0d607), which credits you with a Co-authored-by trailer. The carry isolates the remote-prelude link tests from a host-installed ocx. Closing this PR as superseded by #6787.

@lidge-jun lidge-jun closed this Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). review-ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants