test(cli): align doctor dispatch runtime paths - #5463
Conversation
Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
…atch-runtime-paths Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
…atch-runtime-paths Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
|
Exact-head update for
No merge action was taken. |
…atch-runtime-paths Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
…atch-runtime-paths Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
…atch-runtime-paths Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
huangruiteng
left a comment
There was a problem hiding this comment.
Reviewer: model_agent | GPT-5 | OpenAI
动机
结论:APPROVE 当前 180db2e。#5457 已让 doctor 接收 registry_path 和 runtime_root_override,但现有分发回归仍期待旧三键对象,四种组合全部失败。这里恢复的是有用的精确参数契约,不是新增 doctor 功能或仅追求测试数量。
改动思路
修改原测试,继续由两个真实入口把参数送往既有 doctor handler;collector 替身只捕获其收到的 kwargs 和健康结果。保留成功/失败退出码及 JSON 内容,增加两个路由键的精确期望。没有改 parser、生产状态、权限、UI/Lark、配置或调度,也没有为测试复制一个决策 owner。
具体改动
完整差异只有 tests/test_cli_entrypoint.py、+8/-1。在「test_doctor_dispatch_preserves_owner_flags_and_failure」(:351)内新增 Path 导入,并在 :373 的精确 dict 中保留 deep、agent_type、installation_only,加入 registry_path=Path(".loopx/registry.json") 和 runtime_root_override=None。两个模块与 healthy true/false 共四个独立子进程,均保留 code=0/1 和 JSON stdout 断言。正路验证参数没有掉落;失败路验证不健康结果仍返回 1,不被 bootstrap 隐藏。collector 是明确替身,因此这项测试不能独立证明全部 installation health 或真实 runtime 迁移。
以改动前文档为依据:spec_ref = docs/product/migrations/local-state-path-migration.md;spec_revision = 2fca4a9;criterion_id = common_runtime_root。原条款要求 doctor 检查 supplied runtime-root 或 registry 声明的根;本 PR 完成的是已合入分发参数的精确回归保障,实际 handler 与此条款未变。另按既有 source-entry 文档确认两个入口保留共同 bootstrap/handler,测试不替代生产回读。
对主干的风险
同一旧测试在不可变 base 上四种 doctor 组合全部失败;head 的整个 entrypoint 文件 32 项通过,CLI/参数诊断/source-entry 合集 170 项通过、1 项失败。唯一失败是 test_source_first_usage_disclosure_keeps_json_pure_and_does_not_send 的 notice.version 实际 6、期待 5;独立在同一 base 跑该测试复现相同 identity/6≠5 细节,notice 生产/测试路径不在本 PR 差异。受影响 doctor 参数断言另有通过证据,因此这是既有无关校验失败,不据此向作者提出无关生产修复;仓库健康/合并准备仍应单独处理,未放宽断言或预算。Ruff、diff check 通过,无 CI 查询/等待。
我的整体评价
有真实、长期的仓库价值:守住两个 shipped CLI 入口的五键转发和失败传播,修复旧三键假阴性,沿用原测试而非再建 smoke。搜索现有 coverage 只发现这一共同 fixture;完整当前同作者队列还包含 #5409 的前端 CI 及 #5340/#5338 的独立 authority 修复,没有证据证明同形测试堆积或重复违规,不提出贡献限制。未来方向检查:无需重构生产 handler;与 #5474 整合时保留此精确五键断言即可,不能只比较筛选的四键。这是已验证的测试修复,不把替身当真实安装验证,也不关闭整个迁移项目。APPROVE 后单独核验旧阻塞评审,保留未解决的意见;未合并。
English verdict: APPROVE - 180db2e: exact doctor dispatch contract restored; four baseline cases failed and 32 head entrypoint tests passed. The 170-pass combined run has one independently identical pre-existing notice-version failure, not a PR regression. No merge.
…atch-runtime-paths Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
…atch-runtime-paths Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
Summary
registry_pathandruntime_root_overridearguments added by fix(upgrade): preserve configured state routes and avoid observation-only conflicts #5457Failure evidence
After #5457 reached
main,tests/test_cli_entrypoint.py::test_doctor_dispatch_preserves_owner_flags_and_failurefailed in all four parameterized cases because the mock received the two new arguments while the expected kwargs still described the old contract. The same baseline failure appeared on #5380, #5389, and #5409.Validation
tests/test_cli_entrypoint.py: 32 passedgit diff --check: passedMaintainer review and merge are required.
Signed-off-by: duanjialing.777 duanjialing.777@bytedance.com