test: copy hermes_agent/ into the fixture checkouts that run hermes_bootstrap

hermes_bootstrap now imports hermes_agent.compat on every start. The update-finish, fresh-source-install and relocated-launcher fixtures copy a partial checkout without it, so every boot stopped on ModuleNotFoundError. Real checkouts, wheels and the update startup file list all carry the package.
This commit is contained in:
alt-glitch
2026-11-10 02:41:32 +00:00
parent 4a2c1d1e9b
commit 032e940321
3 changed files with 5 additions and 3 deletions

View File

@@ -44,7 +44,7 @@ def completion(tmp_path, monkeypatch):
# in the working checkout is modified, even by import-time self-heals.
for path in ROOT.glob("*.py"):
shutil.copy2(path, source / path.name)
for name in ("hermes_cli", "hermes_platform", "pm", "agent", "gateway", "tools", "cron"):
for name in ("hermes_cli", "hermes_platform", "hermes_agent", "pm", "agent", "gateway", "tools", "cron"):
shutil.copytree(ROOT / name, source / name,
ignore=shutil.ignore_patterns("__pycache__", "web_dist", "tui_dist"))
shutil.copytree(ROOT / "scripts/build", source / "scripts/build",

View File

@@ -66,7 +66,7 @@ def test_current_installer_publishes_real_dependencies_and_warm_path(tmp_path, s
run([uv, "python", "install", "--no-bin", "--no-registry", minor])
source = tmp_path / "fixture source"
source.mkdir()
for name in ("pm", "hermes_cli", "hermes_platform"):
for name in ("pm", "hermes_cli", "hermes_platform", "hermes_agent"):
shutil.copytree(ROOT / name, source / name, ignore=shutil.ignore_patterns("__pycache__"))
for name in ("utils.py", "hermes_constants.py", "hermes_dir_acl.py", "hermes_yaml.py", "hermes_bootstrap.py",
"setup-hermes.sh"):

View File

@@ -42,7 +42,7 @@ def payload_tree(tmp_path: Path):
py_dir = tmp_path / "stage" / "tools" / "py-1"
repo = tmp_path / "stage" / "repo"
site = tmp_path / "stage" / "venv" / "Lib" / "site-packages"
for d in (bin_dir, py_dir, repo / "hermes_cli", repo / "pm", site):
for d in (bin_dir, py_dir, repo / "hermes_cli", repo / "hermes_agent" / "compat", repo / "pm", site):
d.mkdir(parents=True, exist_ok=True)
# A real interpreter at the shebang's target: the launcher will create
@@ -67,6 +67,8 @@ def payload_tree(tmp_path: Path):
# Exercise the real bootstrap before the fixture entry point.
for relative in ("hermes_bootstrap.py", "hermes_constants.py", "hermes_cli/__init__.py",
"hermes_agent/__init__.py", "hermes_agent/compat/__init__.py",
"hermes_agent/compat/finder.py", "hermes_agent/compat/moves.py",
"pm/environments.py", "pm/filesystem.py", "hermes_cli/runtime_state.py",
"hermes_cli/_early_recovery.py", "hermes_cli/_parser.py",
# prepare_launch returns early for a fixture repo (no .git), but the bootstrap