The card probing 192.168.0.235:7770 — frank-medium's endpoint since the radiance cutover — was still called "frank-small", a service retired on 2026-09-15. The probe target was right; only the identity was wrong, which is the worse half: a green card named after a service that no longer exists teaches the wrong thing about the fleet. It is now frank-medium, described as what it actually is (Qwen3.8-27B Uncensored MXFP4, vllm-radiance, two R9700s behind one endpoint), and frank-large's description stops crediting the retired halogen runtime for work ik_llama.cpp does. The seam added to homepage_config.bats pins the cross-file contract that let this drift: a card's probe target and its name must agree with the fleet, and a retired service must not keep a card.
59 lines
2.3 KiB
Bash
59 lines
2.3 KiB
Bash
#!/usr/bin/env bats
|
|
# Seam: shared/homepage/services.json — the service config the checker reads
|
|
# and the pages render. It must be a JSON list; every entry carries name,
|
|
# category, and a host:port probe. category is user or admin. method, when
|
|
# present, is tcp or http.
|
|
|
|
load helpers
|
|
|
|
@test "services.json: valid schema" {
|
|
python3 - "$REPO_ROOT/shared/homepage/services.json" <<'PY'
|
|
import json, sys
|
|
path = sys.argv[1]
|
|
try:
|
|
data = json.load(open(path))
|
|
except FileNotFoundError:
|
|
sys.exit("services.json not found")
|
|
assert isinstance(data, list), "top level must be a list"
|
|
assert data, "the list must not be empty"
|
|
for svc in data:
|
|
for field in ("name", "category", "probe"):
|
|
assert field in svc, f"{svc.get('name', '?')} is missing {field}"
|
|
assert svc["category"] in ("user", "admin"), svc["category"]
|
|
if "method" in svc:
|
|
assert svc["method"] in ("tcp", "http"), svc["method"]
|
|
host, _, port = svc["probe"].rpartition(":")
|
|
assert host and port.isdigit(), f"bad probe {svc['probe']}"
|
|
PY
|
|
}
|
|
|
|
@test "services.json: every user service has an Open link, status-only backends do not" {
|
|
python3 - "$REPO_ROOT/shared/homepage/services.json" <<'PY'
|
|
import json, sys
|
|
data = json.load(open(sys.argv[1]))
|
|
for svc in data:
|
|
show = svc.get("showLink", True)
|
|
if show:
|
|
assert svc.get("url"), f"{svc['name']} shows a link but has no url"
|
|
else:
|
|
assert not svc.get("url"), f"{svc['name']} is status-only but has a url"
|
|
PY
|
|
}
|
|
|
|
@test "the LLM status cards track the fleet, not retired service names" {
|
|
# This drifted: the card probing Dankserver's :7770 was still named
|
|
# frank-small long after frank-small was retired and frank-medium took that
|
|
# endpoint, so the homepage labelled the fleet's busiest service with a dead
|
|
# name. The probe target was right; only the identity was wrong.
|
|
python3 - "$REPO_ROOT/shared/homepage/services.json" <<'PY'
|
|
import json, sys
|
|
services = json.load(open(sys.argv[1]))
|
|
by_probe = {s["probe"]: s["name"] for s in services}
|
|
medium = by_probe.get("192.168.0.235:7770")
|
|
assert medium == "frank-medium", f"Dankserver :7770 card is named {medium!r}"
|
|
assert "frank-small" not in {s["name"] for s in services}, "retired frank-small still listed"
|
|
# The big endpoint keeps its card too, so a fleet overview shows both.
|
|
assert by_probe.get("127.0.0.1:7770") == "frank-large"
|
|
PY
|
|
}
|