test(core): drop duplicate gitdiff untracked count case - #5468
Conversation
✅ Verification — dropping the duplicate test loses no coverageThis PR removes a single test from TL;DR
1) Coverage equivalence (static)Both tests use the identical setup — fill the per-file map with
The removed case adds nothing the retained one doesn't already assert (only 3 vs 5 untracked files — not a distinct scenario). 2) Mutation testing (the real proof — runs the PR-state suite with the removed test gone)I injected two faults into
Each assertion the removed test made is independently caught by a retained test. The direct duplicate 3) Live run (tmux)VerdictThe removed test is a genuine duplicate, the behavior it guarded stays fully covered by the retained 🇨🇳 中文版(点击展开)✅ 验证 —— 删除这个重复测试不会丢失任何覆盖本 PR 从 结论速览
1)覆盖等价性(静态)两个测试用的是完全相同的构造 —— 先用
被删用例没有任何保留用例没断言到的东西(只是 untracked 文件数 3 vs 5 —— 并非不同场景)。 2)变异测试(真正的证明 —— 在已删除该测试的 PR 状态下运行套件)我往
被删测试做出的每一个断言,都有保留测试独立抓到。那个直接重复的 3)实时运行(tmux)结论被删测试确为重复用例,它所保护的行为仍被保留的 |
|
@qwen-code /triage |
wenshao
left a comment
There was a problem hiding this comment.
No issues found. The removed test counts untracked files in filesCount even after the per-file map is full is fully covered by the adjacent aggregates untracked line counts into linesAdded even when the per-file map is full of tracked entries test, which asserts the same filesCount and perFileStats.size invariants plus linesAdded — a strict superset. LGTM! ✅
— DeepSeek/deepseek-v4-pro via Qwen Code /review
|
Thanks for the PR, @tt-a1i! Template: headings deviate from the PR template — "Summary" instead of "What this PR does", "Test plan" instead of "Reviewer Test Plan", and "Why it's needed", "Risk & Scope", and "Tested on" are absent. The test commands are clear enough to verify the claim, so not blocking on this, but worth aligning with the template for future PRs. On direction: straightforward — removing a genuinely duplicate test case is squarely in scope for test health. Nothing to question here. On approach: the scope is minimal (1 file, −22 lines, 0 additions). The removed test Moving on to code review and testing. 🔍 中文说明感谢 @tt-a1i 的 PR! 模板:标题与 PR 模板 有偏差 —— "Summary" 而非 "What this PR does","Test plan" 而非 "Reviewer Test Plan","Why it's needed"、"Risk & Scope"、"Tested on" 均未出现。测试命令清晰可验证,不作为阻塞项,但建议后续 PR 对齐模板。 方向:明确 —— 删除重复测试用例属于测试健康维护,完全在范围内。 方案:范围最小(1 个文件,−22 行,0 新增)。被删测试 进入代码审查和测试。🔍 — Qwen Code · qwen3.7-max |
Code reviewI wrote down my independent proposal before reading the diff: the The PR matches my proposal exactly. The 22-line deletion is clean — no leftover references, no orphaned helpers, no dead imports. The Real-scenario testingRan Before (main — 59 tests including the duplicate)After (this PR — 58 tests, duplicate removed)Exactly 59 → 58 (one test removed), all green. The retained 中文说明代码审查在读取 diff 之前,我先写下了独立方案: PR 与我的方案完全一致。22 行删除干净利落 —— 无残留引用、无孤立辅助函数、无死导入。 实际测试在 Before(main — 59 个测试,含重复用例)After(本 PR — 58 个测试,已删除重复用例)恰好 59 → 58(删除一个测试),全绿。保留的 — Qwen Code · qwen3.7-max |
|
Stepping back: this is as clean as a test-deletion PR gets. My independent proposal before reading the diff was exactly what the PR does — remove the test whose assertions are a strict subset of the retained The template deviation noted in Stage 1 is minor and doesn't affect reviewability. The PR body clearly states what's being removed, why (duplicate coverage), and how to verify (test commands). That's sufficient. Nothing in this PR needs rethinking. The deletion is correct, the motivation is sound, and the suite is healthier for it. Approving. ✅ 中文说明回顾全局:这是一个尽可能干净的测试删除 PR。我在读 diff 之前写的独立方案与 PR 完全一致 —— 删除那个断言为保留 Stage 1 提到的模板偏差较小,不影响可审查性。PR body 清楚说明了删除什么、为什么(重复覆盖)、如何验证(测试命令)。足够了。 没有需要重新考虑的地方。删除正确,动机合理,测试套件因此更健康。 批准。✅ — Qwen Code · qwen3.7-max |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
wenshao
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅
— DeepSeek/deepseek-v4-pro via Qwen Code /review
Summary
fetchGitDiffuntracked count case that repeats coverage from the stronger line-count aggregation testFixes #5467
Test plan
npm --workspace packages/core run test -- src/utils/gitDiff.test.tsnpx prettier --check packages/core/src/utils/gitDiff.test.tsnpx eslint packages/core/src/utils/gitDiff.test.tsgit diff --checkAI Assistance Disclosure
I used Codex to review the changes, sanity-check the implementation against existing patterns, and help spot potential edge cases.