mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-14 14:12:44 +00:00
tests: pin ink engine in _make_tui_argv npm-bootstrap tests (post-merge semantic fix)
Main's rewritten test_tui_npm_install.py tests call _make_tui_argv expecting the Ink/npm flow unconditionally; with the dual-engine dispatch merged in, _resolve_tui_engine() auto-selects opentui whenever ui-opentui/dist is built in the repo, routing the call away from the path under test (first subprocess became 'node --version' instead of 'npm run build'). Pin the engine to ink via an autouse fixture, mirroring the existing pinning precedent in test_tui_resume_flow.py.
This commit is contained in:
parent
ab37440ce6
commit
e1067dbbe5
756 changed files with 79874 additions and 19585 deletions
|
|
@ -190,6 +190,49 @@ class TestSnapshotEndToEnd:
|
|||
"""Spin up a real LocalEnvironment and confirm the snapshot sources
|
||||
extra init files."""
|
||||
|
||||
def test_exported_env_changes_persist_between_commands(self, tmp_path):
|
||||
env = LocalEnvironment(cwd=str(tmp_path), timeout=15)
|
||||
try:
|
||||
first = env.execute(
|
||||
'export HERMES_SESSION_ENV_PROBE="sticky"; '
|
||||
'export PATH="/tmp/hermes-session-bin:$PATH"; '
|
||||
'echo "first=$HERMES_SESSION_ENV_PROBE"'
|
||||
)
|
||||
second = env.execute(
|
||||
'echo "second=$HERMES_SESSION_ENV_PROBE"; echo "PATH=$PATH"'
|
||||
)
|
||||
finally:
|
||||
env.cleanup()
|
||||
|
||||
assert first["returncode"] == 0
|
||||
assert second["returncode"] == 0
|
||||
assert "first=sticky" in first.get("output", "")
|
||||
output = second.get("output", "")
|
||||
assert "second=sticky" in output
|
||||
assert "/tmp/hermes-session-bin" in output
|
||||
|
||||
def test_venv_style_activation_persists_between_commands(self, tmp_path):
|
||||
venv_bin = tmp_path / ".venv" / "bin"
|
||||
venv_bin.mkdir(parents=True)
|
||||
activate = venv_bin / "activate"
|
||||
activate.write_text(
|
||||
f'export VIRTUAL_ENV="{tmp_path / ".venv"}"\n'
|
||||
f'export PATH="{venv_bin}:$PATH"\n'
|
||||
)
|
||||
|
||||
env = LocalEnvironment(cwd=str(tmp_path), timeout=15)
|
||||
try:
|
||||
first = env.execute('source .venv/bin/activate; echo "venv=$VIRTUAL_ENV"')
|
||||
second = env.execute('echo "venv=$VIRTUAL_ENV"; echo "PATH=$PATH"')
|
||||
finally:
|
||||
env.cleanup()
|
||||
|
||||
assert first["returncode"] == 0
|
||||
assert second["returncode"] == 0
|
||||
output = second.get("output", "")
|
||||
assert f"venv={tmp_path / '.venv'}" in output
|
||||
assert str(venv_bin) in output
|
||||
|
||||
def test_snapshot_picks_up_init_file_exports(self, tmp_path, monkeypatch):
|
||||
init_file = tmp_path / "custom-init.sh"
|
||||
init_file.write_text(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue