Validate umbrella graph WebUI proof
This commit is contained in:
+18
-7
@@ -26,10 +26,15 @@ PLUGIN_REPO = Path(__file__).resolve().parent.parent
|
||||
# Endpoints we expect after the plugin is loaded. Status codes and content
|
||||
# checks are minimal — this is "did it boot", not "is it correct".
|
||||
SMOKE = [
|
||||
{"path": "/healthz", "expect": [200], "kind": "vanilla"},
|
||||
{"path": "/health", "expect": [200], "kind": "vanilla"},
|
||||
{"path": "/api/vault/status", "expect": [200, 401, 403], "kind": "plugin"},
|
||||
{"path": "/plugins/svrnty/app.css", "expect": [200], "kind": "plugin-static"},
|
||||
{"path": "/plugins/svrnty/app.js", "expect": [200], "kind": "plugin-static"},
|
||||
{"path": "/api/umbrella", "expect": [200, 401, 403], "kind": "plugin"},
|
||||
{"path": "/api/umbrella/doc?path=sot/README.md", "expect": [200, 401, 403], "kind": "plugin"},
|
||||
{"path": "/plugins/svrnty/app.css", "expect": [200, 302, 401, 403], "kind": "plugin-static"},
|
||||
{"path": "/plugins/svrnty/app.js", "expect": [200, 302, 401, 403], "kind": "plugin-static"},
|
||||
{"path": "/plugins/svrnty/umbrella.html", "expect": [200, 302, 401, 403], "kind": "plugin-static"},
|
||||
{"path": "/plugins/svrnty/umbrella.css", "expect": [200, 302, 401, 403], "kind": "plugin-static"},
|
||||
{"path": "/plugins/svrnty/umbrella.js", "expect": [200, 302, 401, 403], "kind": "plugin-static"},
|
||||
]
|
||||
|
||||
|
||||
@@ -100,17 +105,23 @@ def main():
|
||||
base = f"http://127.0.0.1:{port}"
|
||||
env = os.environ.copy()
|
||||
env["HERMES_WEBUI_PYTHON_PLUGIN"] = "svrnty_hermes_webui_plugin"
|
||||
env["PORT"] = str(port)
|
||||
env["HERMES_WEBUI_PORT"] = str(port)
|
||||
env["HERMES_REPO_ROOT"] = str(PLUGIN_REPO.parent)
|
||||
env["PYTHONPATH"] = (
|
||||
str(PLUGIN_REPO)
|
||||
if not env.get("PYTHONPATH")
|
||||
else f"{PLUGIN_REPO}{os.pathsep}{env['PYTHONPATH']}"
|
||||
)
|
||||
# Best-effort: start under the agent venv if it exists; else system python.
|
||||
py = Path(args.webui_dir) / "venv" / "bin" / "python"
|
||||
cmd = [str(py) if py.exists() else "python3", "bootstrap.py", "--foreground"]
|
||||
cmd = [str(py) if py.exists() else "python3", "bootstrap.py", str(port), "--foreground"]
|
||||
proc = subprocess.Popen(
|
||||
cmd, cwd=args.webui_dir, env=env,
|
||||
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
|
||||
preexec_fn=os.setsid,
|
||||
)
|
||||
if not _wait_for(f"{base}/healthz", timeout=30):
|
||||
print(f"FAIL: webui did not respond at {base}/healthz within 30s",
|
||||
if not _wait_for(f"{base}/health", timeout=30):
|
||||
print(f"FAIL: webui did not respond at {base}/health within 30s",
|
||||
file=sys.stderr)
|
||||
os.killpg(os.getpgid(proc.pid), signal.SIGTERM)
|
||||
sys.exit(1)
|
||||
|
||||
Reference in New Issue
Block a user