Repository navigation
test: repair main platform CI for Runner selection and run evaluation - #1345
Conversation
…tests main 058a530 does not compile internal/engine tests: #1339 added the allowAuto argument to selectSOPExecutionTarget and #1291's new tests still call the one-argument form, so go vet and the core job fail for every PR merged onto main. This is the same three-line change as #1345, so the two PRs merge cleanly in either order. Co-Authored-By: Claude Code <noreply@anthropic.com>
CR + 部署实测
|
| 项目 | 结果 |
|---|---|
| chatbot 单测 | 531/531 ✅ |
go build / go vet ./internal/engine ./internal/httpapi |
通过 ✅(main 上 vet 报 3 处参数不够) |
| e2e API 全量 | 186 个用例:168 通过,0 失败,16 跳过。新增的 4 个用例都通过 ✅ |
路由覆盖率 --min 85 |
351/412 = 85.2%,通过 ✅。平台日志里 5 个新路由都有请求记录 |
| e2e UI | 25 通过,2 跳过,1 失败。失败的是 03-workbench-settings.spec.mjs:21(会话改名后标题没更新)。本 PR 没改这部分代码,用 main 058a530b 构建的平台跑同一条用例,失败结果完全一样,属于本机环境问题;CI 上 browser 通过 ✅ |
| CI | 16/16 通过 ✅ |
非阻塞:覆盖率 85.2% 离门槛只多 1 个路由。之后谁新加路由却没补 e2e,browser 还会挂。可以考虑在 PR 模板里提醒一下,或者 CI 失败时把「未覆盖路由」列表打印到 job summary 里,方便定位。
结论:LGTM,这个 PR 合进去后 main 的 platform CI 就能恢复。#1332 afa86043 带了同样的 3 行测试修复,两个 PR 谁先合都不冲突。token 是作者本人的账号,所以只评论,不点 Approve。
crispinhu27
left a comment
There was a problem hiding this comment.
初审结论:APPROVE(审查的版本:head 6859c98,base main 058a530)
审查范围
- 4 个测试文件:
internal/engine/sop_executors_test.go,以及e2e/api/20-issues、30-runs、69-assistant-sessions。 - 本 PR 没有改生产代码、CI 配置或 scripts。路由覆盖率门禁仍是
--min 85,没有降低。
和 main CI 失败的对应关系(058a530b)
- core:
sop_executors_test.go:446/531/556报not enough arguments in call to selectSOPExecutionTarget。本 PR 在这三处补了第二个参数true,和生产代码sop_executors.go里的调用一致。 - browser: 只有路由覆盖率没过(350/412 = 85.0% is below 85%)。本 PR 的 CI 里是 355/412 = 86.2%,新覆盖的正好是描述里列的 5 个路由:
clarify-models、issues/:id/images/:imageId、runs/:id/wait、assistant/sessions/:id/read、assistant/sessions/:id/sandbox。 - 当前 head 的 CI: 16 项全部通过,包括 core、browser、platform-required。
本地隔离验证(原生 MySQL 8.4.7 + 本地构建的平台,只用合成数据)
- 编译对照: base 上
go vet ./internal/engine/编译失败,报错和 main CI 一样;head 上通过。TestExecutorCredentialsFollowTheProjectDefaultRunner和TestExecutorCredentialsFollowTheCloudPool都通过。 - engine 全量测试: head 上
go test ./internal/engine/只有 9 个失败,原因都是容器里没有 bwrap。补上 bwrap 后单独重跑这 9 个,全部通过,属于环境问题,和本 PR 无关。 - e2e 三个文件: 在 head 上连跑 3 次,每次 42 个用例:40 通过、0 失败、2 个 todo。把 4 个新增或改过的用例单独挑出来跑,也全部通过,说明不依赖执行顺序。平台访问日志确认这 5 个路由确实被请求到了。
非阻塞说明
30-runs新用例里的eval/apply返回 404,原因是评测本来就没建出来,并没有专门测到「run 等待审批时不能写回建议」这条拦截。所以这条断言偏弱,但没有写错。
没有在本地跑整个 e2e / Playwright 套件和 Go ./... 全量测试,这部分以 PR CI 全绿为准。本次 Review 不代表代码没有任何缺陷。
|
CR + 部署实测:
部署实测(本机平台 + MariaDB 11.8 新库,没有对 Tencent/LoopForge 做部署测试):API e2e 0 失败(包括这次新增的 4 个用例)。本机路由覆盖 351/412 = 85.2%,过线。UI 失败 2 个,都跟本 PR 无关:会话改名是 MariaDB 不支持 |
…-current-main' into codex/fix-main-runner-evaluation-ci
crispinhu27
left a comment
There was a problem hiding this comment.
复审结论:APPROVE(审查版本:head e2d0b4acbbeb48b3885daf03ed88f6c89a8e0ad7,base main 6f3f0b8f,当前 main 832e2bef)。之前在 6859c989 上的 APPROVE 6059419873 已被新推送撤销;那次没有提过问题,所以这次没有需要复测的历史问题。
增量范围(6859c989..e2d0b4ac)
dd83fc55:合入 main。--remerge-diff显示只有e2e/api/20-issues.test.mjs一处冲突。解决方式保留了 main 新增的图片上传用例(含未登录返回 401 的检查),并用created.id补上了本 PR 的clarify-models检查,是对的。同一提交把bot_clarify_test.go里的f.posts换成了waitPosts,轮询等待已入队的澄清消息。e2d0b4ac:合入merge-audit/release-current-main。它的第二个父提交6f3f0b8f已经在 main 上,--remerge-diff为空,没有带进 main 以外的代码。- 现在仍然只改测试,共 4 个文件。
sop_executors_test.go已经不在 diff 里,因为 main 上已有同样的修改。
为什么 waitPosts 改得对:finishBotClarifyRound 先保存会话状态,再由 postBotClarify 把消息入队。所以 waitStatus 返回的时候,消息可能还没写进去。新 helper 用的超时和轮询间隔与 waitStatus 一样(10s / 20ms)。等到消息之后,原来那些「恰好 1 条、kind 和内容都对」的断言照样会跑,断言没有放松。
验证(隔离环境,环境变量清空)
go test ./internal/httpapi -run TestChatClarification:先-count=3;再在-cpu 1,2,8下跑 60 次、-cpu 2,4,8下跑 100 次,同时加压。- base
6f3f0b8f复现了这次修的竞态:bot_clarify_test.go:505越界 panic,:231和:538断言失败。 - head 上这几类失败一次都没出现。
- base
internal/httpapi全量测试:head 和 base 失败的都是同样 13 项,都是环境原因(没有 bwrap 等),没有新增失败。go vet ./internal/httpapi:通过。git merge-tree和当前 main832e2bef合并无冲突。在合并结果上把澄清测试跑了 10 次,全部通过。- e2e API 用例需要 Docker 里的 MySQL,本地没跑;用到的路由都存在,CI 的 browser job 在这个 head 上跑过这些用例并通过。CI 16/16 通过。
不阻塞、供参考:同一文件里的 TestChatClarificationEdgePaths(head 上在 :621)在高并发加压时,偶尔会报 "analysis not cancelled"。base 上也能出现,本 PR 没有引入、也没改到它,所以不算这次的问题。
这次没有发现需要修改的问题,但不代表代码一定没有缺陷。
|
CR + 部署实测: 这次新增的两个提交:合入 main
部署实测(本机 MariaDB 11.8 全新库,用本 PR 构建的平台;没有对 Tencent/LoopForge 做任何部署实测操作)
结论:LGTM。token 是作者本人的账号,所以只评论,不点 Approve。 |
The main-branch platform CI run exposed two issues after the approved PRs were combined.
Verified the focused Engine tests and all four end-to-end cases against a disposable MySQL deployment. Confirmed the five additional routes in the platform access log. The existing route coverage threshold is retained.
Follow-up on the latest main