Files
cc-ci/tests/mumble/functional/test_welcome_text_roundtrip.py
autonomic-bot 472a68b32c
All checks were successful
continuous-integration/drone/push Build is passing
feat(harness): P1 — single registry-backed meta loader (rcust)
One loader: runner/harness/meta.py::load(recipe) -> RecipeMeta (frozen dataclass,
attribute access), backed by the declarative KEYS registry (14 final keys + 3
P2-deprecated). The ONLY exec() of tests/<recipe>/recipe_meta.py. Validation per
the locked decision: unknown ALL-CAPS top-level name or type mismatch = MetaError
(hard error at load); underscore-prefixed names recipe-private; callables only on
hook-typed keys.

Migrated all six legacy loaders (spec §4 L1–L6):
- run_recipe_ci.py::_load_meta deleted; orchestrator loads once, passes meta down
- tests/conftest.py::_recipe_meta deleted; meta fixture returns full RecipeMeta (R3)
- lifecycle.py::_recipe_extra_env/_recipe_meta_flag deleted; deploy_app takes meta
- deps.py::declared_deps deleted; callers read meta.DEPS
- canonical.py::is_enrolled reads through meta.load()
- screenshot.py now actually receives SCREENSHOT through the orchestrator path (R2
  fix; proven by unit test through the real load path)

Mumble private constants underscore-prefixed (_WELCOME_TEXT_MARKER/_MAX_USERS) +
importers fixed. New tests/unit/test_meta.py (all-recipes-load-clean typo gate,
MetaError cases, spec §2 baseline defaults, underscore exemption, doc sync). Docs
§4 key table now GENERATED from the registry (scripts/gen-meta-docs.py); drift
fails CI.

Verified on cc-ci: cc-ci-run -m pytest tests/unit -q -> 175 passed; scripts/lint.sh -> PASS.
2026-06-10 16:46:58 +00:00

32 lines
1.3 KiB
Python

"""mumble — recipe-specific functional test #1 (Phase 2 P3, beyond parity).
Config round-trip: the harness deploys the recipe with a unique WELCOME_TEXT marker
(recipe_meta.EXTRA_ENV -> MUMBLE_CONFIG_WELCOMETEXT). A client that completes the handshake
receives the server's welcome text in the ServerSync message. This proves our deploy-time
configuration actually propagated into the running murmur server AND is delivered to clients over
the real protocol — not just that a port is open. Version-independent (asserts OUR marker, not a
hard-coded upstream string).
"""
from __future__ import annotations
import os
import sys
sys.path.insert(0, os.path.dirname(__file__))
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import _mumble_proto # noqa: E402
import recipe_meta # noqa: E402
def test_configured_welcome_text_surfaces_in_serversync(live_app):
marker = recipe_meta._WELCOME_TEXT_MARKER
r = _mumble_proto.retry_handshake(attempts=12, interval=5.0)
assert r["server_sync"], f"ServerSync handshake did not complete — {r.get('error')}"
welcome = r["welcome_text"] or ""
assert marker in welcome, (
f"configured welcome-text marker {marker!r} not present in the server's ServerSync "
f"welcome_text (got {welcome!r}) — deploy-time config did not propagate"
)