fix(e2e): re-add ~/.local/bin to PATH after .bashrc sourcing#3156
Closed
hunglp6d wants to merge 1 commit into
Closed
fix(e2e): re-add ~/.local/bin to PATH after .bashrc sourcing#3156hunglp6d wants to merge 1 commit into
hunglp6d wants to merge 1 commit into
Conversation
install.sh places openshell/nemoclaw under ~/.local/bin, but sourcing .bashrc triggers nvm.sh which rebuilds $PATH from scratch, dropping the entry. Four E2E test helpers (deployment-services, diagnostics, network-policy, credential-migration) checked for the binaries after .bashrc but before re-adding ~/.local/bin, causing them to fail with "nemoclaw not found" / "openshell still missing after install". Apply the same PATH-refresh guard already used by the passing test-cloud-onboard-e2e.sh: re-add ~/.local/bin immediately after sourcing .bashrc so the check succeeds regardless of nvm ordering. Signed-off-by: Hung Le <hple@nvidia.com>
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This was referenced May 7, 2026
Contributor
Author
jyaunches
added a commit
that referenced
this pull request
May 7, 2026
## Summary The e2e test harness sources `~/.bashrc` to pick up the freshly-installed `nemoclaw` CLI, but on images whose `.bashrc` resets `PATH` (or unconditionally prepends system paths) this wipes the `~/.local/bin` entry that `install.sh` just added, breaking every downstream `nemoclaw ...` invocation. This PR re-adds `~/.local/bin` to `PATH` after `.bashrc` sourcing and extracts the pattern into a shared helper so it stays consistent as more scripts adopt it. ## Related Issue Supersedes #3156 (cherry-picked with author credit preserved to Hung Le). ## Changes - **Fix (cherry-picked from #3156, attribution preserved):** re-add `~/.local/bin` to `PATH` after sourcing `~/.bashrc` in the cloud e2e test scripts, so the installed `nemoclaw` CLI remains resolvable on images whose `.bashrc` rewrites `PATH`. - **Refactor:** extract the PATH-refresh pattern into `test/e2e/lib/install-path-refresh.sh` with two helpers: - `nemoclaw_refresh_install_env` — source `.bashrc` then guarantee `~/.local/bin` is on `PATH` - `nemoclaw_ensure_local_bin_on_path` — idempotent prepend of `~/.local/bin` - Migrate 6 scripts (4 PR-touched + 2 adjacent references) to the helper: `test-cloud-inference-e2e.sh`, `test-cloud-onboard-e2e.sh`, `test-credential-migration.sh`, `test-deployment-services.sh`, `test-diagnostics.sh`, `test-network-policy.sh`. - Net diff: +67 / −33 lines across 7 files (including the new 41-line helper). **Follow-up (not in this PR):** ~23 additional e2e scripts also carry a copy of the inline `.local/bin on PATH` guard. Intentionally left out to keep this PR scoped to the scripts flagged in the original review. Tracked in #3201. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Verification - [x] `npx prek run --all-files` passes - [ ] `npm test` passes - [x] Tests added or updated for new or changed behavior - [x] No secrets, API keys, or credentials committed - [ ] Docs updated for user-facing behavior changes - [ ] `make docs` builds without warnings (doc changes only) - [ ] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) **Verification notes:** - `bash -n` syntax check passes on the new helper and all 6 migrated scripts. - Helper is sourceable via all three patterns the scripts use: `dirname "${BASH_SOURCE[0]}"/lib/`, `${E2E_DIR}/lib/`, and `${SCRIPT_DIR_TIMEOUT}/lib/`. - Functional test of `nemoclaw_ensure_local_bin_on_path` confirmed: prepends `~/.local/bin` when missing, is idempotent when already present. - Zero inline leftovers of the old pattern in the 6 migrated scripts. - `npm test` has 18 unrelated timeout failures in `test/install-preflight.test.ts` (installer integration suite) on this machine; this PR does not touch that file (0 diff lines against it) and does not modify any code path it exercises. The actual e2e scripts changed here run in the Brev cloud suite, which is out of the `npm test` scope. --- Signed-off-by: Julie Yaunches <jyaunches@nvidia.com> --------- Signed-off-by: Hung Le <hple@nvidia.com> Signed-off-by: Julie Yaunches <jyaunches@nvidia.com> Co-authored-by: Hung Le <hple@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Four E2E test scripts fail during
ensure_install()/ Phase 0 becausesource ~/.bashrctriggersnvm.sh, which rebuilds$PATHfrom scratch and drops~/.local/bin— the directory whereinstall.shplaces theopenshellandnemoclawbinaries. Thecommand -vcheck immediately after.bashrcsourcing cannot find the binaries and exits with "nemoclaw not found" / "openshell still missing after install".This PR applies the same PATH-refresh guard already used by the passing
test-cloud-onboard-e2e.sh: re-add~/.local/binimmediately after sourcing.bashrc.Diagnosed from nightly-e2e run #25468013036 (commit
c25df40).Related Issue
Changes
test/e2e/test-deployment-services.sh— add PATH refresh after.bashrcsourcing ininstall_nemoclaw()test/e2e/test-diagnostics.sh— same fix ininstall_nemoclaw()test/e2e/test-network-policy.sh— same fix ininstall_nemoclaw()test/e2e/test-credential-migration.sh— add.bashrcsourcing + PATH refresh afterinstall.shcall in Phase 0Type of Change
Evidence
Failing jobs (4):
nemoclaw not foundafter install.shnemoclaw not foundafter install.shnemoclaw not foundafter install.shopenshell still missing after installRoot cause:
nvm.sh(loaded via.bashrc) reconstructs$PATHwithout preserving~/.local/bin, soinstall.sh-managed binaries become invisible.Passing reference:
test-cloud-onboard-e2e.shlines 204-214 already guard against this with:Verification
bash -npasses on all four edited scriptsnpx prek run --all-filespassesnpm testpassesSigned-off-by: Hung Le hple@nvidia.com