Skip to Content
Agore Evalalpha

测试

测试分层、网络隔离约定、常用命令与 CI 各 job 的覆盖范围以本页为准。

改动源码前先看清测试的约束:分层按包组织,网络全部隔离,命令统一走 ./dx。CI 的 job 定义以 .github/workflows/ci.yml 为准。

分层

包覆盖
internal/config加载、校验、维度组合、模板、数据展开。
internal/modelscatalog 构建、解析优先级、成本。
internal/driversOpenAI、Anthropic、Google 协议,cli driver 与多轮渲染。
internal/planes/llmproxy请求与响应录制、工具调用提取、预算熔断、mock 上游。
internal/planes/mcpgatewaystdio 与 HTTP MCP 桥接、跨轮次保活、调用录制。
internal/sessionmanifest、JSONL、payload CAS、workspace tree、StateAt。
internal/trajectorysession records 的轨迹构建与匹配。
internal/agentruntimebuiltin Agent、mock LLM、workspace 工具、MCP 工具、session record 映射。
internal/answerboxed、answer_line、last_integer、choice 与 regex 答案抽取。
internal/benchrefbenchmark ref 解析(./path vs org/repo)。
internal/syncbenchlock 检查、漂移检测与封存(含 benchlock 行为)。
internal/cigate 策略评估、CI 环境识别、GitHub Check 与评论输出。
internal/inspect只读检查报告、校验规则,以及文本、JSON、Markdown、SARIF 输出。
internal/uiTable、Properties、FileTree、Steps、Status 与 Progress 渲染。
internal/cli命令行为与 TUI。
internal/runner端到端矩阵、Skill 安装、MCP 生命周期、错误状态、过滤与 trials。
internal/storerun 与 results 生命周期、latest 解析。
internal/report聚合、100 分制、Markdown、HTML、JUnit 与 JSON。
internal/graders六个内置评分器(含 LLM judge)。
internal/datasetJSONL、HuggingFace 分页与限制。
internal/planes/sandboxworkspace 与 Skill 复制。
internal/procgroup进程组清理。

网络隔离

  • Model 协议用 httptest。
  • 数据源用临时 JSONL 或 httptest。
  • 不使用真实 API Key。
  • 本地文件数据源不写缓存,测试之间不会互相影响。

常用命令

Shell
./dx test
./dx test -race ./...
./dx test -run TestRunSkillInstall ./internal/runner
./dx check

涉及 sh 的测试在 Windows 上 t.Skip。

CI

.github/workflows/ci.yml 在推送到 main 与拉取请求时运行三个 job:

job步骤
test./dx vet、./dx test -race ./...、./dx build、./dx docs-types、./dx docs-build
examples遍历 examples/*/eval.yaml 执行 ./dx inspect,对 tinyMMLU 与 matharena-apex 执行 benchmark sync --offline,运行 npx -y skills list 校验 skills lock
first-run在临时目录执行 init、inspect、eval 与 report latest --format json,断言运行输出、结果数量与 session 中的工具记录

first-run 覆盖首次使用路径,安装、脚手架或输出的腐化会先在这里暴露。发布前的完整预检(./dx release-check)见发布版本。在用户项目中接入 CI gate 的做法见为 PR 加评测门禁。

On this page