test(ci): 给 src/ 补绝对下限 —— 两道门都放行「大量删除测试文件」(#817) - #854
Conversation
#817 实测:origin/main 上删掉 46 个 agent-network/src 测试里的 40 个,test745 仍 test_files=6 executed_files=6 RESULT: PASS rc=0 因为分母和执行数会跟着现实一起缩水 —— `executed >= test_files` 只能抓「runner 少跑了文件」,抓不到「文件没了」。test725 更彻底:它连 src 的分母都没有, 只有一行 `bun test src/`。 这次: test745 加 AGENT_NETWORK_SRC_FLOOR=40(磁盘上现有 46) test725 补 src 分母 + AGENT_NODE_SRC_FLOOR=80(现有 91) 并照 test745 的形状补上 executed >= discovered 下限是「大量删除」的绊线,不是精确计数:真删了测试就故意改这个数, 让删除这件事必须在 diff 里显形。 见证红(把插入的块逐字抽出来跑,ROOT 指向构造的树): 文件齐 46 / 91 → OK 按 #817 删到只剩 6 个 → FAIL: only 6 test file(s) under agent-network/src, floor is 40 FAIL: only 6 test file(s) under agent-node/src, floor is 80 不动 #800 的范围:那个 PR 守的是 tests/ 目录(FLOOR 15 / 5),这个补的是 src/。
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec5f52ef9c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| # 把「磁盘上有几个」和「bun 跑了几个」绑在一起:范围被悄悄收窄(glob 改了、 | ||
| # 测试挪进子目录、bun 配置多了个 exclude)时自己变红。 | ||
| executed=$(grep -Eo 'across [0-9]+ files' /tmp/test725-green.log | grep -Eo '[0-9]+' | tail -1) |
There was a problem hiding this comment.
Add the required Docker evidence for both gate changes
I checked the commit's changed-file list and the existing test725/test745 reports: only the two runners changed, while the commit explicitly says the complete Docker gates were not run. That leaves this new Bun-summary parser and both floor checks without the repository-required container E2E verification or updated saved results; run both suite Dockerfiles and commit the resulting docs/tests/report-test725-... and report-test745-... evidence before merging.
AGENTS.md reference: AGENTS.md:L7-L8
Useful? React with 👍 / 👎.
|
独立深审结论:CLEAN,但必须在 #800 后 rebase(exact head
人工 union 必须同时保留:src 分母+floor+executed/discovered、tests/ dispatcher+tests floor、以及 #800 收紧后的 NOT COVERED:审查员构造了“各只剩 6 个 src 测试”的 Docker 反证,但共享宿主导出层过慢而中止,未取得最终两条命名 floor 输出;因此不把该动态 witnessed-red 冒充为已独立复现。 未 approve、未 merge、未 deploy。 |
结论:前提我独立复现了,修法见证真红,建议合并。一条 MINOR(不挡合并,已量化)这个 PR 之前只有一条 bot 评论。我没看 PR 的自述数字,自己从 一、前提属实 —— 我独立复现了"删测试门不响"
和 PR 正文引用的 #817 数字一致。 二、修法见证真红同一个删除操作,合入本 PR 后: 而未变异时: 红/绿两侧都见证过,不是只看绿。 计数也核了: 三、
|
修 #817。
问题
两道聚合单测门都放行「测试文件被大量删除」。#817 的实测:
origin/main上删掉46 个
agent-network/src/*.test.ts里的 40 个,test745 仍然原因是分母和执行数会跟着现实一起缩水。
executed >= test_files能抓的是「runner 少跑了文件」,抓不到「文件没了」—— 两边同时变成 6,断言照样成立。
test725 更彻底:它连
src的分母都没有,只有一行bun test src/。改动
下限是**「大量删除」的绊线,不是精确计数**:留了少量余量给正常增删,
真要删测试就得故意改这个数 —— 目的是让「删测试」这件事必须在 diff 里显形,
而不是悄悄让门的范围缩水。
见证红
把插入的块逐字抽出来跑(
ROOT指向构造的目录树):🔴 说清楚这次没做什么:上面跑的是抽出来的 floor 块,不是在 Docker 里跑完整的门。
完整门要构建镜像,本机磁盘 93%,我没有在未确认的情况下起构建。
floor 本身是纯 bash 算术 +
find | wc -l,抽出来跑和在门里跑是同一段代码;但「完整门在容器里端到端仍然绿」这一格,要 CI 来填。
和 #800 的关系
不重叠,别混:
src/tests/AGENT_NETWORK_TESTS_FLOOR=15/AGENT_NODE_TESTS_FLOOR=5AGENT_NETWORK_SRC_FLOOR=40/AGENT_NODE_SRC_FLOOR=80+ test725 的分母#800 的范围写的是「让两个门覆盖
tests/目录」,所以src/的下限单独开在这里。两个 PR 都改
run.sh,合并时注意先后顺序会有上下文冲突(插入点不同,内容不冲突)。