fix(tester): discover catalogs in subprojects
This commit is contained in:
+26
-3
@@ -11,7 +11,30 @@ description: >-
|
||||
# Tester:项目测试目录
|
||||
|
||||
开始时解析本 `SKILL.md` 所在目录为 `<skill-dir>`。项目根用
|
||||
`git rev-parse --show-toplevel`。目录固定为 `<root>/.pouch/tester/`。
|
||||
`git rev-parse --show-toplevel`。目录固定为目标测试项目的 `<root>/.pouch/tester/`;父仓库
|
||||
和 Git submodule 可以各自拥有独立目录。
|
||||
|
||||
## 多测试项目 / 子项目
|
||||
|
||||
一个仓库可能同时包含后端测试目录和 `app` 等子项目测试目录。用例属于拥有
|
||||
`catalog.yaml` 的项目,不能把多个 catalog 的 cases 合并成一份清单或共用一次运行快照。
|
||||
|
||||
开始列出或运行前,先发现目标仓库下的独立测试根:
|
||||
|
||||
```bash
|
||||
python3 <skill-dir>/scripts/catalog.py roots --root <repo-root>
|
||||
```
|
||||
|
||||
选择规则:
|
||||
|
||||
- `<repo-root>/.pouch/tester/catalog.yaml` 存在时,它是一个独立测试根;
|
||||
- 同时检查 Git submodule 和一层普通子项目目录;
|
||||
- 只有一个嵌套 catalog 时,可直接用该路径继续 `list/select/run`;
|
||||
- 有多个 catalog 时按用户指定的组件分别执行,例如 `--root app`,不要猜测或合并;
|
||||
- 每个测试根单独生成 `.pouch/tester/runs/*.yaml`/`.csv`,交付记录可分别引用这些快照。
|
||||
|
||||
如果父仓库没有 catalog 但子项目有 catalog,不能把“父目录无 catalog”报告为环境失败;先用
|
||||
`roots` 找到子项目并继续。只有发现不到任何 catalog,才按缺少 tester 目录处理。
|
||||
|
||||
Agent 执行目标优先来自项目根 `.pouch/agent.yaml` 的 `tester.<name>` binding,由共享
|
||||
`agent-runtime` 解析 environment、host、project、path 和 profile。`.pouch/tester/local.yaml`
|
||||
@@ -21,7 +44,7 @@ Agent 执行目标优先来自项目根 `.pouch/agent.yaml` 的 `tester.<name>`
|
||||
用脚本读写目录,不要把 `cases/` 整库灌进上下文。术语与命名理由见 [references/concepts.md](references/concepts.md):
|
||||
|
||||
```bash
|
||||
python3 <skill-dir>/scripts/catalog.py <list|select|show|validate|next-id|run-script> \
|
||||
python3 <skill-dir>/scripts/catalog.py <roots|list|select|show|validate|next-id|run-script> \
|
||||
--root <project-root> [参数]
|
||||
```
|
||||
|
||||
@@ -34,7 +57,7 @@ tester agent 配置。
|
||||
|
||||
## 选择模式
|
||||
|
||||
- 还没有 `.pouch/tester/catalog.yaml`,或用户说初始化 tester:执行「初始化」。
|
||||
- 先用 `roots` 检查当前仓库及子项目;没有任何 `.pouch/tester/catalog.yaml`,或用户说初始化 tester:执行「初始化」。
|
||||
- 列出、有哪些测试、一共多少条:执行「列出」。
|
||||
- 看某一条怎么测:执行「查看」。
|
||||
- 加一条 / 完善 / 改验证 / 退役:执行「维护」。
|
||||
|
||||
Reference in New Issue
Block a user