Skip to content

test: remove redundant and low-value test cases - #4746

Merged
wbxl2000 merged 2 commits into
MoonshotAI:mainfrom
kimi-agent-bot:chore/test-cleanup
Nov 11, 2026
Merged

wbxl2000 merged 2 commits into
MoonshotAI:mainfrom
kimi-agent-bot:chore/test-cleanup

Conversation

@kimi-agent-bot

@kimi-agent-bot kimi-agent-bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Requirement or Bug

测试套件中存在重复场景、只验证旧实现模拟代码的用例,以及可以合并的细粒度断言。这些内容增加维护成本,但没有增加相应的回归保护。

本 PR 只清理 kimi-code 测试,净减少 38 个测试声明,不修改生产代码。配套的桌面端测试清理由 MoonshotAI/kimi-code-app#1210 处理。

Bug Reproduction Steps

N/A

Root Cause

N/A

Code Changes

本次按“删除明确重复或低价值用例、合并等价场景、保留边界覆盖”的原则整理 5 个测试文件:

模块 删除或合并内容 保留的覆盖
fullCompaction 删除已由 strategy 及现有 fullCompaction 用例覆盖的重复边界场景 自动与手动压缩、溢出压缩退避、消息移除和上下文应用
isImageLine 独立回归文件 删除只模拟旧实现的测试,以及与 terminal-image.test.ts 重复的超长行和协议场景 有效场景已并入 terminal-image.test.ts
editor 合并窄宽度下的 CJK、混合字符和两种 padding 配置用例 源偏移、宽 grapheme、ZWJ family emoji、paste marker 和宽度 1–8 渲染
markdown 删除两条低价值反斜杠转义用例 其他 Markdown 行为覆盖不变
terminal-image 合并 iTerm2、Kitty、ANSI、负例和混合协议的等价声明 不同位置、最小载荷、超长行、终端能力无关、混合协议、重复图片段,以及普通文本、控制序列、不完整序列、空行和路径负例

变更统计为 69 行新增、527 行删除;46 个原测试声明合并为 8 个声明,净减少 38 个。minidb review-round3 的非 ASCII 主键测试完整保留,以覆盖删除、扫描、前缀、索引、查询、批量操作和恢复路径。

Behavior Changes and Affected Users

None。本 PR 只修改测试文件,没有修改运行时代码、配置默认值、公开 API、契约文件或用户可见输出,因此不需要 changeset 或文档更新。

受影响模块的验证结果:

  • pi-tui:1,146 项通过,2 项跳过。
  • fullCompaction / strategy:125 项通过。
  • minidb review-round3:原有 12 项覆盖完整保留,当前 HEAD 的 CI 已通过。
  • TypeScript typecheck:通过。
  • git diff --check:通过。

先前本地完整 lint 的 tsgolint 进程曾被 SIGKILL 中止;当前 HEAD 的 CI lint 已通过。

Checklist

  • I have read the CONTRIBUTING document.
  • No related issue; the requirement and scope are described above.
  • Existing test coverage has been reviewed; this PR adds no feature.
  • The behavior-change table above is complete; no runtime behavior, default, or changeset-covered behavior changes.
  • Ran gen-changesets skill; this tests-only PR needs no changeset.
  • This tests-only PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 93ce714

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T07:22:53.269731Z 93ce714 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kimi-agent-bot

Copy link
Copy Markdown
Collaborator Author

@codex review

请只审查本 PR 相对 base 的 diff。若同类问题出现在多处,请在一轮中一次列全。每条发现标注 P0 / P1 / P2;不要报告纯风格或个人偏好问题。

@pkg-pr-new

pkg-pr-new Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@93ce714
npx https://pkg.pr.new/@moonshot-ai/kimi-code@93ce714

commit: 93ce714

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fcb1485831

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

// Regression tests for the third deep-review round:
// A) Non-ASCII (multi-byte UTF-8) string keys must work on every surface.
// B) readOnly open must never mutate the database files (no WAL truncation).
// Regression tests for non-ASCII keys and read-only WAL recovery.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 保留非 ASCII 公共路径的回归覆盖

对于非 ASCII 主键,这里删掉的并非同一路径的重复断言:剩余用例只用原始键调用 get/has 并验证单条 WAL/快照恢复,而被删掉的 del、scan/prefix、各类索引/query 返回键分别会经过独立的规范化或反向 UTF-8 解码路径,batch 恢复还经过单独的批帧编解码。若这些路径把 用户A 返回成二进制串、无法匹配 Unicode 前缀,或批量恢复时按错字节长度,当前 4 个用例仍会全部通过;请至少用表驱动方式保留这些独立路径的边界覆盖,而不是整块移除。

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已采纳。93ce71480f283a15e37e0fb48f3cbbc8fa68d04a 恢复 review-round3.test.ts 的全部非 ASCII 主键覆盖,包括 del、scan/prefix、各类索引、query、batch 和恢复路径。当前 PR 不再修改该文件。

@kimi-agent-bot

Copy link
Copy Markdown
Collaborator Author

@codex review

请增量审查自上一轮评审以来的变更。只审查本 PR 相对 base 的 diff;同类问题一次列全,并标注 P0 / P1 / P2。

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 93ce71480f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@wbxl2000
wbxl2000 merged commit f26481d into MoonshotAI:main Nov 11, 2026
18 checks passed
@XRX193 XRX193 mentioned this pull request Nov 12, 2026
5 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants