fix: HERMES_WEBUI_SKIP_ONBOARDING unconditional + guard against config writes + 10 skipped tests fixed — v0.50.65
Fixes two SKIP_ONBOARDING bugs and eliminates 10 permanently-skipped integration tests. - SKIP_ONBOARDING=1 now honoured unconditionally (no longer gated on chat_ready) - apply_onboarding_setup refuses to write config/env files when SKIP_ONBOARDING is set - TestMediaEndpointIntegration (6) and TestOnboardingGateIntegration (4): collection-time skip guards removed; server reachability checked at runtime with fail() not skip() Tests: 1327 passed, 0 skipped. Admin merge — self-built PR, Nathan authorized full merge process in session.
This commit is contained in:
@@ -235,17 +235,21 @@ def _server_reachable() -> bool:
|
||||
return False
|
||||
|
||||
|
||||
# Mark integration tests to only run when test server is up
|
||||
requires_server = pytest.mark.skipif(
|
||||
not _server_reachable(),
|
||||
reason="Test server on :8788 not reachable",
|
||||
)
|
||||
# No collection-time skip guard — conftest.py starts the server via its
|
||||
# autouse session fixture BEFORE tests run. A collection-time check always
|
||||
# sees no server and turns every test into a skip. Server reachability is
|
||||
# asserted inside the _require_server fixture instead so failures are loud.
|
||||
|
||||
|
||||
@requires_server
|
||||
class TestOnboardingGateIntegration:
|
||||
"""Live-server integration tests for the onboarding gate fix."""
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _require_server(self):
|
||||
"""Assert server is reachable at test runtime (not collection time)."""
|
||||
if not _server_reachable():
|
||||
pytest.fail(f"Test server at {BASE} is not reachable")
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _clean(self):
|
||||
hermes_home = _server_hermes_home()
|
||||
@@ -254,6 +258,16 @@ class TestOnboardingGateIntegration:
|
||||
yield
|
||||
for rel in ("config.yaml", ".env"):
|
||||
(hermes_home / rel).unlink(missing_ok=True)
|
||||
# Force the server to reload its in-memory config after file deletion.
|
||||
# apply_onboarding_setup() calls reload_config() which caches provider
|
||||
# state in the server process. Deleting files on disk does not clear
|
||||
# that cache — the next test would see provider_configured=True.
|
||||
# GET /api/personalities always calls reload_config(), giving us a
|
||||
# cheap way to flush the cache without a server restart.
|
||||
try:
|
||||
_http_get("/api/personalities")
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def test_no_config_wizard_fires(self):
|
||||
"""No config.yaml → completed=False."""
|
||||
|
||||
Reference in New Issue
Block a user