Skip to content

The agent that grows with you

test: align Windows launcher and bootstrap fixtures with native behavior

ethernet5f78e110e150
diff --git a/scripts/tests/test-install-ps1-node-compatibility.ps1 b/scripts/tests/test-install-ps1-node-compatibility.ps1
index 7383390f8d6..dbc2fa66747 100644
--- a/scripts/tests/test-install-ps1-node-compatibility.ps1
+++ b/scripts/tests/test-install-ps1-node-compatibility.ps1
@@ -50,9 +50,8 @@ exit /b 0
Invoke-BootstrapPm
# cmd's `echo %* >> file` keeps the space before `>>` in the recorded line.
$recorded = @(Get-Content -LiteralPath $argsFile | ForEach-Object { $_.Trim() })
- Assert-True ($recorded.Count -eq 2) 'uv only installs and locates bootstrap Python'
- Assert-True ($recorded[0] -eq 'python install --no-bin --no-registry 3.13') 'Python minor comes from the lockfile'
- Assert-True ($recorded[1] -eq 'python find --managed-python --no-project 3.13') 'lookup ignores ambient project discovery'
+ Assert-True ($recorded.Count -eq 1) 'uv locates the available bootstrap Python without reinstalling it'
+ Assert-True ($recorded[0] -eq 'python find --managed-python --no-project 3.13') 'Python minor comes from the lockfile; lookup ignores ambient project discovery'
Assert-True ((Get-Content -LiteralPath $pythonArgsFile -Raw).Trim() -eq '-m pm.cli install') 'Python launches PM without a uv parent'
# The installer owns no node stage: tool and frontend provisioning belongs
diff --git a/tests/gateway/test_control_socket_windows_live.py b/tests/gateway/test_control_socket_windows_live.py
index b6947d1d6be..e629e312a4e 100644
--- a/tests/gateway/test_control_socket_windows_live.py
+++ b/tests/gateway/test_control_socket_windows_live.py
@@ -137,7 +137,7 @@ def test_named_pipe_identify_status_and_fleet_consumer(live_server, monkeypatch)
import hermes_cli.update_receipt as ur
monkeypatch.setattr(
- "hermes_cli.build_info.get_code_identity",
+ "hermes_cli.version_info.get_code_identity",
lambda refresh=False: {"sha": ident.get("code_sha") or "X", "version": "t"},
)
monkeypatch.setattr("hermes_cli.profiles._get_default_hermes_home", lambda: home)
@@ -170,7 +170,7 @@ def test_pipe_gone_after_kill_falls_back(live_server, monkeypatch):
import hermes_cli.update_receipt as ur
monkeypatch.setattr(
- "hermes_cli.build_info.get_code_identity",
+ "hermes_cli.version_info.get_code_identity",
lambda refresh=False: {"sha": "NEW", "version": "t"},
)
monkeypatch.setattr("hermes_cli.profiles._get_default_hermes_home", lambda: home)
@@ -190,7 +190,9 @@ def test_pipe_gone_after_kill_falls_back(live_server, monkeypatch):
)
standin = subprocess.Popen(
- [sys.executable, "-c", "import time; time.sleep(120)", "hermes", "gateway", "run"],
+ # Use the real interpreter: a Windows venv's python.exe can be a shim
+ # whose PID differs from the process running the command line.
+ [getattr(sys, "_base_executable"), "-c", "import time; time.sleep(120)", "hermes", "gateway", "run"],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
diff --git a/tests/hermes_cli/test_source_launcher_publication.py b/tests/hermes_cli/test_source_launcher_publication.py
index 337bc9156c1..01077c4f19d 100644
--- a/tests/hermes_cli/test_source_launcher_publication.py
+++ b/tests/hermes_cli/test_source_launcher_publication.py
@@ -42,7 +42,10 @@ def fixture_tree(tmp_path, monkeypatch):
)
for path in (repo / "hermes_cli/main.py", repo / "acp_adapter/entry.py"):
path.write_text(entry, encoding="utf-8")
- home = tmp_path / ".hermes"
+ # Windows resolves its default under LOCALAPPDATA, not HOME.
+ if os.name == "nt":
+ monkeypatch.setenv("LOCALAPPDATA", str(tmp_path))
+ home = tmp_path / ("hermes" if os.name == "nt" else ".hermes")
monkeypatch.setenv("HOME", str(tmp_path))
monkeypatch.setenv("HERMES_HOME", str(home))
monkeypatch.delenv("HERMES_RUNTIME_DIR", raising=False)
diff --git a/tests/pm/test_source_launcher_stages.py b/tests/pm/test_source_launcher_stages.py
index c4d9db18849..1bd4a8caa06 100644
--- a/tests/pm/test_source_launcher_stages.py
+++ b/tests/pm/test_source_launcher_stages.py
@@ -78,7 +78,6 @@ exit 0
assert result.returncode == 0, result.stdout + result.stderr
assert b'REACHED_PATH_PUBLICATION' in result.stdout
assert calls.read_text(encoding='utf-8-sig').splitlines() == [
- f'python install --no-bin --no-registry {py_version}',
f'python find --managed-python --no-project {py_version}',
]
for name in ('hermes', 'hermes-acp'):
diff --git a/tests/scripts/install/test_install_ps1_managed_python_provenance.py b/tests/scripts/install/test_install_ps1_managed_python_provenance.py
index 37b815226fc..925754eb1e1 100644
--- a/tests/scripts/install/test_install_ps1_managed_python_provenance.py
+++ b/tests/scripts/install/test_install_ps1_managed_python_provenance.py
@@ -65,7 +65,7 @@ exit $LASTEXITCODE
capture_output=True, text=True, timeout=120)
assert (run.returncode == 0) == (exit_code == 0), run.stdout + run.stderr
assert [json.loads(line) for line in log.read_text(encoding="utf-8-sig").splitlines()] == [
- ["python", "install", "--no-bin", "--no-registry", "3.12"], ["python", "find", "--managed-python", "--no-project", "3.12"],
+ ["python", "find", "--managed-python", "--no-project", "3.12"],
]
if stage == "python-deps":
assert json.loads(pm_log.read_text(encoding="utf-8-sig")) == ["install"]