Skip to content

refactor(e2e): migrate remaining 23 scripts to install-path-refresh helper #3201

@jyaunches

Description

@jyaunches

Summary

Follow-up to #3200 (which fixed #3156 and extracted the shared install-path-refresh helper): migrate the remaining 23 e2e scripts that still carry an inline copy of the .local/bin on PATH pattern to use the new helper at test/e2e/lib/install-path-refresh.sh.

Background

On cloud images whose ~/.bashrc rewrites PATH, sourcing .bashrc after running install.sh wipes the ~/.local/bin entry and breaks all downstream nemoclaw ... invocations in e2e. The original fix (#3156, cherry-picked into #3200) re-adds ~/.local/bin to PATH after the .bashrc source.

As part of #3200's review feedback, the pattern was extracted into two shared 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

#3200 migrated the 6 scripts the original PR touched (or were directly adjacent). A full grep of test/e2e/ afterward found 23 more scripts carrying the same inline pattern that were intentionally left out to keep #3200 small and reviewable.

Scope

Migrate all 23 scripts below to use the helper.

Standard migrations (~18 scripts)

One .bashrc source + 2 PATH guards → replace with nemoclaw_refresh_install_env at the first site and nemoclaw_ensure_local_bin_on_path at the second.

  • test/e2e/test-device-auth-health.sh
  • test/e2e/test-gpu-double-onboard.sh
  • test/e2e/test-gpu-e2e.sh
  • test/e2e/test-hermes-discord-e2e.sh
  • test/e2e/test-inference-routing.sh
  • test/e2e/test-messaging-providers.sh
  • test/e2e/test-overlayfs-autofix.sh
  • test/e2e/test-rebuild-hermes.sh
  • test/e2e/test-rebuild-openclaw.sh
  • test/e2e/test-sandbox-operations.sh
  • test/e2e/test-sandbox-survival.sh
  • test/e2e/test-shields-config.sh
  • test/e2e/test-snapshot-commands.sh
  • test/e2e/test-spark-install.sh
  • test/e2e/test-token-rotation.sh
  • test/e2e/test-upgrade-stale-sandbox.sh

Heavy users — check for redundant guards (2 scripts)

One .bashrc source + 3 PATH guards each. Worth checking whether all 3 sites are still needed after consolidation, or whether one invocation of nemoclaw_refresh_install_env at the top is sufficient.

  • test/e2e/test-full-e2e.sh
  • test/e2e/test-hermes-e2e.sh

Odd ducks — review before migrating (4 scripts)

These don't match the standard shape and may involve small behavioral fixes rather than a pure refactor.

  • test/e2e/test-kimi-inference-compat.sh — sources .bashrc but has 0 PATH guards. Likely broken today on images that rewrite PATH; migrating fixes a latent bug.
  • test/e2e/test-messaging-compatible-endpoint.sh — same shape as above (sources .bashrc, 0 PATH guards). Same latent-bug note.
  • test/e2e/test-docs-validation.sh — has a PATH guard but does not source .bashrc. Probably wants nemoclaw_ensure_local_bin_on_path only, not the full refresh.
  • test/e2e/test-issue-2478-crash-loop-recovery.sh — only 1 PATH guard. Probably missing the post-.bashrc re-add; migration fixes the same latent bug as fix(e2e): re-add ~/.local/bin to PATH after .bashrc sourcing #3156.
  • test/e2e/test-skill-agent-e2e.sh — same shape (1 PATH guard). Same note.

Acceptance criteria

  • All 23 scripts source test/e2e/lib/install-path-refresh.sh and use one of the two helpers at each site that currently inlines the pattern.
  • Zero inline leftovers of the old .local/bin / .bashrc pattern in the migrated scripts (verify with grep -rn '\.local/bin' test/e2e/ --include='*.sh' — only the helper and explicit helper calls should match).
  • The 4 "odd duck" scripts call out in the PR description whether the migration is a pure refactor or includes a behavioral fix for the fix(e2e): re-add ~/.local/bin to PATH after .bashrc sourcing #3156-class latent bug.
  • bash -n passes on all 23 scripts.
  • At least one affected Brev e2e target (e.g. test-full-e2e.sh or test-hermes-e2e.sh) is run end-to-end to confirm no regression.

Suggested PR shape

  • Title: refactor(e2e): migrate remaining scripts to install-path-refresh helper
  • Scope: all 23 scripts in one PR since the replacements are mechanical against a helper that has already landed and been reviewed in fix(e2e): re-add ~/.local/bin to PATH after .bashrc sourcing #3200.
  • Body: enumerate the 4 odd-duck cases separately so reviewers know where a behavioral change is bundled into the refactor.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: e2eEnd-to-end tests, nightly failures, or validation infrastructure

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions