feat(harness): P1 — single registry-backed meta loader (rcust)
All checks were successful
continuous-integration/drone/push Build is passing
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.
This commit is contained in:
@ -26,9 +26,9 @@ def test_configured_max_users_surfaces_in_serverconfig(live_app):
|
||||
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, (
|
||||
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"
|
||||
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).
|
||||
|
||||
@ -20,7 +20,7 @@ import recipe_meta # noqa: E402
|
||||
|
||||
|
||||
def test_configured_welcome_text_surfaces_in_serversync(live_app):
|
||||
marker = recipe_meta.WELCOME_TEXT_MARKER
|
||||
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')}"
|
||||
|
||||
@ -31,18 +31,19 @@ HEALTH_OK = (200,)
|
||||
DEPLOY_TIMEOUT = 900 # two images to pull (mumble-server + mumble-web) on a cold node
|
||||
HTTP_TIMEOUT = 300
|
||||
|
||||
# A unique, stable welcome-text marker the round-trip test asserts surfaces over the protocol.
|
||||
WELCOME_TEXT_MARKER = "cc-ci-mumble-welcome-7f3a9c"
|
||||
# A unique, stable welcome-text marker the round-trip test asserts surfaces over the protocol
|
||||
# (underscore prefix = recipe-private constant, exempt from registry validation — rcust P1).
|
||||
_WELCOME_TEXT_MARKER = "cc-ci-mumble-welcome-7f3a9c"
|
||||
# A distinctive max-users value (not the recipe default 100) the server_config test asserts.
|
||||
MAX_USERS = 42
|
||||
_MAX_USERS = 42
|
||||
|
||||
# BASE deploy (0.2.0): mumble-web only — NO host-ports (0.2.0 predates it). The voice-config env is
|
||||
# set here and persists across the upgrade so it takes effect on the latest (where the custom config
|
||||
# round-trip tests assert it).
|
||||
EXTRA_ENV = {
|
||||
"COMPOSE_FILE": "compose.yml:compose.mumbleweb.yml",
|
||||
"WELCOME_TEXT": WELCOME_TEXT_MARKER,
|
||||
"USERS": str(MAX_USERS),
|
||||
"WELCOME_TEXT": _WELCOME_TEXT_MARKER,
|
||||
"USERS": str(_MAX_USERS),
|
||||
}
|
||||
|
||||
# UPGRADE-target deploy (latest 1.0.0+): add the NATIVE compose.host-ports.yml so 64738 is
|
||||
|
||||
Reference in New Issue
Block a user