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:
alt-glitch 2026-06-12 10:32:40 +05:30
parent ab37440ce6
commit e1067dbbe5
756 changed files with 79874 additions and 19585 deletions

View file

@ -365,6 +365,40 @@ class TestPluginDiscovery:
}
assert len(non_bundled) == 1
def test_failed_discovery_is_not_cached(self, tmp_path, monkeypatch):
"""A sweep that raises must not cache 'discovered' with no plugins.
Regression for the stranded-empty-registry class of failures: callers
(e.g. tools.web_tools._ensure_web_plugins_loaded) swallow discovery
exceptions as warnings, so if a failed sweep flipped ``_discovered``
permanently, every later call would early-return against an empty
registry ("No web provider configured") for the process lifetime.
"""
plugins_dir = tmp_path / "hermes_test" / "plugins"
_make_plugin_dir(plugins_dir, "retry_plugin")
monkeypatch.setenv("HERMES_HOME", str(tmp_path / "hermes_test"))
mgr = PluginManager()
def _boom(self_inner):
raise RuntimeError("sweep failed")
monkeypatch.setattr(PluginManager, "_discover_and_load_inner", _boom)
with pytest.raises(RuntimeError, match="sweep failed"):
mgr.discover_and_load()
assert mgr._discovered is False, "failed sweep was cached as discovered"
# A later call (with discovery healthy again) must do the real scan.
monkeypatch.undo()
monkeypatch.setenv("HERMES_HOME", str(tmp_path / "hermes_test"))
mgr.discover_and_load()
assert mgr._discovered is True
non_bundled = {
n: p for n, p in mgr._plugins.items()
if p.manifest.source != "bundled"
}
assert len(non_bundled) == 1
def test_discover_skips_dir_without_manifest(self, tmp_path, monkeypatch):
"""Directories without plugin.yaml are silently skipped."""
plugins_dir = tmp_path / "hermes_test" / "plugins"