test: guard direct action registry in lan smoke
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
|
||||
- `直接导入主页` 现在不再把人扔回 `找对标` 总览,而是直接落到新建同步任务的详情页,方便立即看同步进度。
|
||||
- `直接分析高分作品` 现在会直接回到当前对象,而不是回到整个 `找对标` 首页,让高分拆解结论和相似账号建议更容易接着看。
|
||||
- LAN smoke 现在会直接校验 `import-homepage / search-similar-accounts / save-benchmark-link / refresh-tracking / mark-tracking-read` 这些主 Agent 直执行动作已经注册在线,避免后续回退。
|
||||
|
||||
### 主 Agent 可直接执行分析账号、加入跟踪、创建 Agent
|
||||
|
||||
|
||||
@@ -34,22 +34,25 @@ index_file="$tmp_dir/index.html"
|
||||
runtime_file="$tmp_dir/runtime.js"
|
||||
health_file="$tmp_dir/health.json"
|
||||
session_file="$tmp_dir/session.json"
|
||||
projects_file="$tmp_dir/projects.json"
|
||||
action_registry_file="$tmp_dir/action-registry.json"
|
||||
integrations_file="$tmp_dir/integrations.json"
|
||||
bootstrap_file="$tmp_dir/bootstrap.json"
|
||||
compat_file="$tmp_dir/compat.html"
|
||||
token_file="$tmp_dir/token.txt"
|
||||
project_id_file="$tmp_dir/project-id.txt"
|
||||
|
||||
echo "[1/6] check fnOS web"
|
||||
echo "[1/7] check fnOS web"
|
||||
curl_fetch "$WEB_URL/" >"$index_file"
|
||||
rg -Fq "StoryForge" "$index_file"
|
||||
echo "web ok"
|
||||
|
||||
echo "[2/6] check runtime config"
|
||||
echo "[2/7] check runtime config"
|
||||
curl_fetch "$WEB_URL/assets/storyforge-runtime-config.js" >"$runtime_file"
|
||||
rg -Fq "$BACKEND_URL" "$runtime_file"
|
||||
echo "runtime config ok"
|
||||
|
||||
echo "[3/6] check collector healthz"
|
||||
echo "[3/7] check collector healthz"
|
||||
curl_fetch "$BACKEND_URL/healthz" >"$health_file"
|
||||
python3 -c '
|
||||
import json, pathlib, sys
|
||||
@@ -67,7 +70,7 @@ if lan_routing.get("cutvideoRouteMode") != "fnos_tunnel":
|
||||
print("healthz ok")
|
||||
' "$health_file" "$CUTVIDEO_URL"
|
||||
|
||||
echo "[4/6] check auto-session"
|
||||
echo "[4/7] check auto-session"
|
||||
curl_fetch -X POST "$BACKEND_URL/v2/auth/auto-session" \
|
||||
-H 'content-type: application/json' \
|
||||
-d '{}' >"$session_file"
|
||||
@@ -88,7 +91,36 @@ print(f"auto-session ok: {username}")
|
||||
' "$session_file" "$token_file"
|
||||
token="$(cat "$token_file")"
|
||||
|
||||
echo "[5/6] check integrations health"
|
||||
echo "[5/7] check live project context and action registry"
|
||||
curl_fetch "$BACKEND_URL/v2/projects" \
|
||||
-H "Authorization: Bearer $token" >"$projects_file"
|
||||
python3 -c '
|
||||
import json, pathlib, sys
|
||||
projects = json.loads(pathlib.Path(sys.argv[1]).read_text())
|
||||
if not isinstance(projects, list) or not projects:
|
||||
raise SystemExit("projects endpoint returned no project")
|
||||
project_id = str(projects[0].get("id") or "")
|
||||
if not project_id:
|
||||
raise SystemExit("project id missing")
|
||||
pathlib.Path(sys.argv[2]).write_text(project_id, encoding="utf-8")
|
||||
print(f"project ok: {project_id}")
|
||||
' "$projects_file" "$project_id_file"
|
||||
project_id="$(cat "$project_id_file")"
|
||||
curl_fetch "$BACKEND_URL/v2/oneliner/action-registry?project_id=$project_id" \
|
||||
-H "Authorization: Bearer $token" >"$action_registry_file"
|
||||
python3 -c '
|
||||
import json, pathlib, sys
|
||||
payload = json.loads(pathlib.Path(sys.argv[1]).read_text())
|
||||
items = payload.get("items") or []
|
||||
keys = {str(item.get("action_key") or "") for item in items}
|
||||
required = {"import-homepage", "search-similar-accounts", "save-benchmark-link", "refresh-tracking", "mark-tracking-read"}
|
||||
missing = sorted(required - keys)
|
||||
if missing:
|
||||
raise SystemExit(f"action registry missing: {missing}")
|
||||
print("action registry ok")
|
||||
' "$action_registry_file"
|
||||
|
||||
echo "[6/7] check integrations health"
|
||||
curl_fetch "$BACKEND_URL/v2/integrations/health" \
|
||||
-H "Authorization: Bearer $token" >"$integrations_file"
|
||||
python3 -c '
|
||||
@@ -105,7 +137,7 @@ if not cutvideo.get("supports_uploads"):
|
||||
print("integrations ok")
|
||||
' "$integrations_file" "$CUTVIDEO_URL"
|
||||
|
||||
echo "[6/6] check fnOS tunnel endpoints"
|
||||
echo "[7/7] check fnOS tunnel endpoints"
|
||||
curl_fetch "$CUTVIDEO_URL/api/bootstrap" >"$bootstrap_file"
|
||||
curl_fetch "$COMPAT_URL/" >"$compat_file"
|
||||
python3 -c '
|
||||
|
||||
Reference in New Issue
Block a user