All checks were successful
continuous-integration/drone/push Build is passing
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.
39 lines
1.8 KiB
Python
39 lines
1.8 KiB
Python
"""mumble — recipe-specific functional test #2 (Phase 2 P3, beyond parity).
|
|
|
|
Server-limit config round-trip via the ServerConfig protocol message. The harness deploys with a
|
|
distinctive USERS value (recipe_meta.EXTRA_ENV -> MUMBLE_CONFIG_USERS, the server's max-users cap,
|
|
set to a non-default 42). A client that completes the handshake receives a ServerConfig message
|
|
carrying the server's enforced limits (max_users, allow_html, message_length, ...). Asserting
|
|
max_users == our configured value proves the recipe wires deploy-time limits into the running
|
|
server and enforces them — a distinctive, characteristic mumble behaviour (server capacity policy),
|
|
not health-only. Version-independent (asserts OUR configured value).
|
|
"""
|
|
|
|
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_max_users_surfaces_in_serverconfig(live_app):
|
|
r = _mumble_proto.retry_handshake(attempts=12, interval=5.0)
|
|
|
|
assert r["server_sync"], f"ServerSync handshake did not complete — {r.get('error')}"
|
|
cfg = r["server_config"]
|
|
assert cfg, f"server did not send a ServerConfig message — {r!r}"
|
|
assert cfg.get("max_users") == recipe_meta._MAX_USERS, (
|
|
f"ServerConfig.max_users={cfg.get('max_users')!r} does not match the configured "
|
|
f"USERS={recipe_meta._MAX_USERS} — deploy-time server-limit config did not propagate"
|
|
)
|
|
# allow_html defaults true in the recipe; assert it is present/boolean to prove the field set
|
|
# is the real ServerConfig (not an empty/garbled decode).
|
|
assert cfg.get("allow_html") in (
|
|
0,
|
|
1,
|
|
), f"ServerConfig.allow_html unexpected: {cfg.get('allow_html')!r}"
|