- 新增 pam_deploy_graph 包,包含 agent、action router、runner、parser 和配置加载能力 - 支持 hybrid_node_mcp 路由策略:PAM_HOME 走脚本 action,PAM_NODE 走 MCP - 新增 fake runner 和 CLI 预演/全局流程验证入口 - 新增路由、输出解析、配置加载、脚本命令构造、Skill 策略加载测试 - 在 README 中记录当前代码骨架、实现进度、使用方式和下一步建议
49 lines
1.1 KiB
Python
49 lines
1.1 KiB
Python
from pam_deploy_graph.script_runner import ScriptActionRunner
|
|
|
|
|
|
def test_build_shell_action_command():
|
|
runner = ScriptActionRunner()
|
|
command = runner.build_command(
|
|
"publish-version",
|
|
script_entry="deploy.sh",
|
|
config_path="./config.txt",
|
|
hash_code="abc",
|
|
trace_file_path="./logs/trace.log",
|
|
)
|
|
assert command == [
|
|
"bash",
|
|
"./deploy.sh",
|
|
"--config",
|
|
"./config.txt",
|
|
"--action",
|
|
"publish-version",
|
|
"--hash-code",
|
|
"abc",
|
|
"--trace-file",
|
|
"./logs/trace.log",
|
|
]
|
|
|
|
|
|
def test_build_powershell_action_command():
|
|
runner = ScriptActionRunner()
|
|
command = runner.build_command(
|
|
"rollback-ip",
|
|
script_entry="deploy.ps1",
|
|
config_path=".\\config.txt",
|
|
ip="192.168.1.10",
|
|
stop_first=True,
|
|
)
|
|
assert command == [
|
|
"powershell",
|
|
"-File",
|
|
".\\deploy.ps1",
|
|
"-ConfigPath",
|
|
".\\config.txt",
|
|
"-Action",
|
|
"rollback-ip",
|
|
"-Ip",
|
|
"192.168.1.10",
|
|
"-RollbackStopFirst",
|
|
]
|
|
|