Repository navigation
test(cli): 补 git status 自身失败分支用例(#2644 follow-up) - #2649
Merged
Merged
Conversation
复审指出:改用脏状态桩后,cli.ts 的「读取 git 状态失败」分支(git status 非零退出)全仓再无覆盖。加第二个桩(status 输出哨兵到 stderr 并 exit 1), 断言 CLI 报读取失败、exit 1,且不进入 pull/build。 变异:该桩 status 改返回干净 exit 0 → 用例被 STUB_UNEXPECTED 守卫咬红 (Bun 腿实测 1 fail)。Bun/Node 双腿 3/3。 Co-Authored-By: Claude Code <[email protected]>
deepcoldy
requested review from
47seek,
LucasIcarus,
xiaoxueSunn and
xiongz-c
as code owners
October 31, 2026 18:22
|
@deepcoldy 合入 master 后的 Midscene E2E 失败:Feishu live Midscene 失败。 这次运行覆盖 f308264…46bd9c50e(4 个提交),同批合入的还有 #2648 #2645 #2586,失败不一定由本 PR 引起。
|
This was referenced Oct 31, 2026
|
🚀 Released in v3.56.0 |
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.
背景
#2644 把 cli-update-alias 的
PATH: ''隔离换成非空桩目录(修 Bun 腿真跑git pull的 #2643)。复审时确认:改后src/cli.ts的「读取 git 状态失败」分支(git status --porcelain自身非零退出)在全仓再无覆盖。本 PR 补上这条用例。内容与复审过的提交逐字一致(#2644 合入后该提交晚了几分钟推到分支、未进 PR,这里在最新 master 上重提,delta 逐字节相同)。
改动(仅测试)
writeGitStubhelper:在独立临时目录里写桩 git,status 走给定响应,其余子命令 exit 97 + 哨兵(防流程越过干净检查进入 pull/build)。status向 stderr 输出哨兵并 exit 1 → 断言 CLI 报「读取 git 状态失败」、exit 1,且不进入 pull(STUB_UNEXPECTED不出现)。验证
bun test test/cli-update-alias.test.ts:3 pass;bunx vitest run同文件:3 passed;tsc 通过。纯测试改动,无运行时影响。
🤖 Generated with Claude Code