"superbench/vscode:/vscode.git/clone" did not exist on "6d895da83c5b0490bf26d7c4cdf2903abbb660e3"
Commit c5912e3b authored by one's avatar one
Browse files

[hytop] Inject hy-smi path for robustness

parent 9e35a37b
......@@ -120,6 +120,8 @@ def collect_from_host(
[
*_build_ssh_option_args(ssh_timeout=ssh_timeout, ssh_options=ssh_options),
target.hostname,
"env",
"PATH=/opt/hyhal/bin:$PATH",
"hy-smi",
*hy_smi_args,
]
......@@ -178,6 +180,8 @@ def collect_python_from_host(
[
*_build_ssh_option_args(ssh_timeout=ssh_timeout, ssh_options=ssh_options),
target.hostname,
"env",
"PATH=/opt/hyhal/bin:$PATH",
_build_remote_python_shell_command(python_code),
]
)
......@@ -229,6 +233,8 @@ def build_remote_python_command(
[
*_build_ssh_option_args(ssh_timeout=ssh_timeout, ssh_options=ssh_options),
target.hostname,
"env",
"PATH=/opt/hyhal/bin:$PATH",
_build_remote_python_shell_command(python_code),
]
)
......
......@@ -93,6 +93,7 @@ class TestCollectFromHostRemote:
assert "BatchMode=yes" in cmd
assert "-n" in cmd
assert "-T" in cmd
assert "env" in cmd
@patch("hytop.core.ssh.subprocess.run")
def test_hy_smi_args_forwarded(self, mock_run):
......@@ -115,6 +116,8 @@ class TestCollectPythonFromHost:
collect_python_from_host("node01", ssh_timeout=5, cmd_timeout=10, python_code="print('ok')")
cmd = mock_run.call_args[0][0]
assert cmd[0] == "ssh"
assert "env" in cmd
assert any("PATH=/opt/hyhal/bin" in str(part) for part in cmd)
assert any(str(part).startswith("python3 -c ") for part in cmd)
@patch("hytop.core.ssh.subprocess.run")
......@@ -199,6 +202,8 @@ class TestHostTargetParsing:
assert cmd[0] == "ssh"
assert "-p" in cmd
assert "3333" in cmd
assert "env" in cmd
assert any("PATH=/opt/hyhal/bin" in str(part) for part in cmd)
@patch("hytop.core.ssh.subprocess.run")
def test_collect_python_from_host_custom_port(self, mock_run):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment