chore: minor doc polish after refactor review
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -101,7 +101,7 @@ def test_whatever():
|
||||
|
||||
**何时用它**:service 层出现『调用第三方 HTTP / RPA stub』但又不能把真实系统纳入 CI。**契约测试**(复制 [`tests/samples/test_service_contract.py.sample`](../tests/samples/test_service_contract.py.sample))应优先组合 FakeAdapter,而不是直接把 CLI when-json 断言堆上天。
|
||||
|
||||
把它看成:**你把不确定性折叠进可控表格**,而不是在生产日志里才第一次看到错位字段。
|
||||
把它看成:**你把不确定性收敛到可控的测试矩阵里**,而不是在生产日志里才第一次看到错位字段。
|
||||
|
||||
---
|
||||
|
||||
@@ -124,12 +124,12 @@ Golden fixture 流程同理([`tests/samples/test_golden_cases.py.sample`](../t
|
||||
任何 touching **真实租户数据** 的路径:
|
||||
|
||||
1. **禁止**硬编码 token / cookie / 内部域名落入仓库;
|
||||
2. **禁止**默认套件 silent import integration;
|
||||
2. **禁止**默认套件隐式导入 integration;
|
||||
3. **真实 RPA** 只能标记为手动触发(双人复核 / 本地 `.env` 不入库)。
|
||||
|
||||
范式阅读 [`tests/integration/README.md`](../tests/integration/README.md):那里有针对凭证来源、目录 artifact 忽略策略的补充。
|
||||
|
||||
记住:**测试代码也是一种部署面**,别把 staging 凭证烘焙进来。
|
||||
记住:**测试代码也是一种部署面**,别把 staging 凭证写死进仓库。
|
||||
|
||||
---
|
||||
|
||||
@@ -156,9 +156,9 @@ Golden fixture 流程同理([`tests/samples/test_golden_cases.py.sample`](../t
|
||||
|
||||
| 红线 | 解释 |
|
||||
|------|------|
|
||||
| 不改业务凑测试 | 除非需求变更已确认,否则别让 CI 绿通过阉割业务分支达成 |
|
||||
| 不改业务凑测试 | 除非需求变更已确认,否则**不要为了让 CI 变绿而砍掉业务分支** |
|
||||
| **默认套件零外联** | 不把真实 HTTP / 浏览器写进 `tests/test_*.py` |
|
||||
| `.sample` 尊重 | 集成范式改名前先读完 README;别让 `.sample` silent 变成根测试 |
|
||||
| `.sample` 尊重 | 集成范式改名前先读完 README;别让 `.sample` 悄悄变成根测试 |
|
||||
| **零硬编码凭证** | token / cookie / 生产 URL → 用虚构域名或 vault ref |
|
||||
| mock 优先 | 逻辑应在 service + FakeAdapter,而不是巨胖 CLI 断言 |
|
||||
| 结构化错误 | 断言错误码字段,而不是 substring of stderr 漂移集合 |
|
||||
|
||||
Reference in New Issue
Block a user