Repository navigation
fix(ci): #1495 测试稳定性门禁识别搬动的既有代码,并在 CI 中运行门禁自测 - #1793
Merged
Merged
Conversation
- verify-test-stability.mjs 以 base 修订建立“规则 + 所属测试声明 + 语句文本”的基线多重集,head 新增行能在基线中认领到同样条目的算搬动,不再当作新增;未改动行先认领基线,避免同一测试里复制一条 sleep 躲过门禁 - 有 --base 时文件内容从 git 修订读取,结果不再依赖工作区;diff 固定 --no-renames 与 a/ b/ 前缀,不受用户 diff 配置影响 - 删除文件也进入基线;--head 必须与 --base 同时给出;shell 包装不再偷偷注入 --platform macos - 自测补齐跨文件搬动、换测试、复制语句、去掉例外注释、平台过滤和真实 git 仓库的用例;macOS CI 的 Classify changes 作业运行该自测 - 撤回上一提交为通过门禁加的 3 条 test-stability: allow 例外,这 3 处 sleep 是搬动的既有代码,由门禁自行识别 - Skill 写明门禁判定方式与两种比对模式
xiaoyumuxi
marked this pull request as ready for review
November 7, 2026 11:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue / Linked issue
PR 类型 / Type
改动说明 / What changes
背景 / Why
#1791 把 Java 逻辑搬出 Core 时,#1495 的测试稳定性门禁把搬动的测试当成新写的慢测试,CI 因此失败。为让 #1791 通过,当时在 3 处 sleep 上加了
test-stability: allow例外;这些 sleep 本身是既有代码,只是跟着测试换了位置。这个提交是在 #1791 合并之后才推上分支的,没有进入那次合并,所以单独提交。它撤回那 3 条例外,改为让门禁自己识别搬动,并让门禁的自测在 CI 里运行。改动 / Changes
scripts/verify-test-stability.mjs(Skill 脚本):以 base 修订建立“规则 + 所属测试声明 + 语句文本”的基线多重集。head 新增行能在基线中认领同一条目的算搬动;未改动行先认领基线,避免在同一测试里复制一条 sleep 混过去。有--base时文件内容从 git 修订读取,结果不再依赖工作区;diff 固定--no-renames和a/ b/前缀,不受用户 diff 配置影响;删除文件也进基线;--head必须与--base同时给出。scripts/verify-test-stability.sh:不再注入--platform macos,由调用方显式给出平台。scripts/test-verify-test-stability.mjs:自测补齐跨文件搬动、换测试、复制语句、去掉例外注释、平台过滤和真实 git 仓库的用例。.github/workflows/ci-macos.yml:Classify changes 作业新增一步,运行门禁自测(只需 Node.js,几秒完成)。.agents/skills/write-stable-tests/SKILL.md:写明门禁的判定方式与两种比对模式。rust/lithe-core/src/lsp/interface/engine.rs:撤回上一提交为通过门禁加的 3 条test-stability: allow例外(该文件删除一个测试辅助函数的改动已随 fix(epic,core,macos): 把 Java 专属逻辑全部移出 Core 与 macOS 宿主,改走通用插件 API #1791 合入,本 PR cherry-pick 后只保留例外的撤回)。不在本 PR 范围内 / Out of scope
类型专属:fix
复现与根因
4db9b4670之前门禁只按 head 的文件位置与语句文本判断新增,不认 base 修订里的同一语句;该修复提交在 fix(epic,core,macos): 把 Java 专属逻辑全部移出 Core 与 macOS 宿主,改走通用插件 API #1791 合并后才推上分支,没有进入合并。检查项
.agents/skills/write-stable-tests/scripts/test-verify-test-stability.mjs的跨文件搬动用例在旧版门禁上失败verify-test-stability.sh是唯一包装,CI 与test-macos.sh均经它调用.agents/notes/implemented/bug-fix/记录:判定方式已写进 SKILL.md(规则真源)范围检查 / Scope checks
功能矩阵 / Feature matrix
N/A:不改产品能力。
统一日志系统 / Structured logging
N/A:不改日志。
界面文案 / i18n
N/A:不改界面文案。
逻辑归属 / Logic placement
性能与内存 / Performance and memory
N/A:CI 新增自测只需 Node.js,几秒完成。
设置 / Settings
N/A:不涉及设置。
插件与共享契约 / Plugin and shared contracts
N/A:不改契约。
发行包与资源 / Bundle and resources
N/A:不改运行时资源。
无用代码与重构 / Dead code and refactoring
验证 / Verification
node .agents/skills/write-stable-tests/scripts/test-verify-test-stability.mjs./.agents/skills/write-stable-tests/scripts/verify-test-stability.sh --platform all --base origin/preview --head HEADactionlint .github/workflows/ci-macos.yml未能执行的检查和原因: Windows 侧 CI 由仓库工作流运行,本机未执行。
提交前确认 / Final checks
preview创建;目标分支:preview.build/、target/、dist/、.artifacts/等产物,没有凭据、个人路径和未脱敏的日志或截图