chore: auto release commit (2026-09-14 23:55:58)
All checks were successful
技能自动化发布 / release (push) Successful in 6s
All checks were successful
技能自动化发布 / release (push) Successful in 6s
This commit is contained in:
@@ -18,6 +18,7 @@ test_* 返回 (False, msg) 即 abort 发布。
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
@@ -217,6 +218,49 @@ def test_skill_md_slug_alignment() -> tuple[bool, str]:
|
||||
return True, f"slug={md_slug}"
|
||||
|
||||
|
||||
def test_data_management_actions() -> tuple[bool, str]:
|
||||
"""数据管理动作必须绑定业务表,并映射到实际 CLI 命令。"""
|
||||
actions_path = _REPO_ROOT / "assets" / "actions.json"
|
||||
actions = json.loads(actions_path.read_text(encoding="utf-8"))["actions"]
|
||||
by_id = {action["id"]: action for action in actions}
|
||||
|
||||
expected = {
|
||||
"scan-expiring-contracts": "toolbar",
|
||||
"collect-from-platform": "toolbar",
|
||||
"generate-renewal-task": "row",
|
||||
"dispatch-task-notice": "batch",
|
||||
"mark-contract-renewed": "row",
|
||||
}
|
||||
for action_id, placement in expected.items():
|
||||
action = by_id.get(action_id)
|
||||
if not action:
|
||||
return False, f"缺少数据管理动作 {action_id}"
|
||||
if placement not in action.get("placements", []):
|
||||
return False, f"{action_id} 缺少 {placement} placement"
|
||||
if "合同台账" not in action.get("bind", {}).get("tables", []):
|
||||
return False, f"{action_id} 未绑定合同台账"
|
||||
if action.get("entrypoint", {}).get("command") != action_id:
|
||||
return False, f"{action_id} CLI command 映射错误"
|
||||
return True, "5 个数据管理动作均绑定合同台账并映射到 CLI"
|
||||
|
||||
|
||||
def test_collect_platform_defaults_to_browser() -> tuple[bool, str]:
|
||||
"""平台采集默认显示浏览器;--headless 仅用于已登录自动化。"""
|
||||
from cli.app import build_parser
|
||||
|
||||
parser = build_parser()
|
||||
default_args = parser.parse_args(["collect-from-platform"])
|
||||
if default_args.headless:
|
||||
return False, "collect-from-platform 默认不应使用无头模式"
|
||||
headless_args = parser.parse_args(["collect-from-platform", "--headless"])
|
||||
if not headless_args.headless:
|
||||
return False, "--headless 未启用无头模式"
|
||||
legacy_args = parser.parse_args(["collect-from-platform", "--show-browser"])
|
||||
if legacy_args.headless:
|
||||
return False, "--show-browser 兼容别名未保留浏览器模式"
|
||||
return True, "默认浏览器模式,--headless 和 --show-browser 行为正确"
|
||||
|
||||
|
||||
# ---------- db.repository:v1.1.2 新增的 sandbox card 解析 ----------
|
||||
|
||||
def test_parse_sandbox_card_row_format() -> tuple[bool, str]:
|
||||
@@ -716,6 +760,8 @@ def main() -> int:
|
||||
_run("util/month_match", test_month_match)
|
||||
_run("constants/skill_md_version_alignment", test_skill_md_version_alignment)
|
||||
_run("constants/skill_md_slug_alignment", test_skill_md_slug_alignment)
|
||||
_run("assets/data_management_actions", test_data_management_actions)
|
||||
_run("cli/collect_platform_browser_default", test_collect_platform_defaults_to_browser)
|
||||
_run("db/parse_sandbox_card_row", test_parse_sandbox_card_row_format)
|
||||
_run("db/parse_sandbox_card_narrative", test_parse_sandbox_card_narrative_format)
|
||||
_run("db/parse_sandbox_card_empty_invalid", test_parse_sandbox_card_empty_and_invalid)
|
||||
|
||||
Reference in New Issue
Block a user