Test_Agent/tests/robogo/test_scenarios.py
jiawei.chen 6f6053ff51 feat: TestAgent 智能测试平台 v1.0
- CLI + Web 双平台,基于 LLM 的 TDD+DDD 自动化测试生成
- 集成 unified-test-platform 903 个 D-Cloud 用例 + 13 个 Robogo 场景
- Agent 5 步流水线: 扫描 -> DDD -> LLM 生成测试
- 精确回归 + UI 变更检查
- 可视化 HTML 测试报告
- 暗色/亮色主题切换
- 19 个 API 端点 + 6 个 SPA 页面
- 15/15 项 TDD+DDD 合规
2026-07-08 11:27:38 +08:00

36 lines
1.2 KiB
Python

"""Robogo 全链路巡检场景 pytest 收集入口
将 11 个 Robogo 场景脚本注册为 pytest 测试,使 `pytest --collect-only` 能统计全部用例。
"""
import subprocess
import sys
import pytest
SCENARIOS = [
("compute_resource", "开发机生命周期"),
("desktop_lifecycle", "云桌面生命周期"),
("file_system", "文件系统巡检"),
("image_generation", "图像生成巡检"),
("mirror_assets", "镜像资产巡检"),
("monkey", "Monkey 测试"),
("openclaw", "OpenClaw 巡检"),
("quantization", "量化工具巡检"),
("test_billing", "计费测试"),
("three_d_assets", "3D 资产巡检"),
("three_d_generation", "3D 生成巡检"),
]
@pytest.mark.robogo
@pytest.mark.parametrize("scenario,display_name", SCENARIOS, ids=lambda x: x)
def test_robogo_scenario(scenario, display_name):
"""运行单个 Robogo 巡检场景"""
script = f"framework/scripts/{scenario}_scenario.py"
result = subprocess.run(
[sys.executable, script],
capture_output=True,
text=True,
timeout=300,
)
if result.returncode != 0:
pytest.fail(f"[{display_name}] 场景失败:\n{result.stderr or result.stdout}")