Skip to content

test(cli): 补 git status 自身失败分支用例(#2644 follow-up) - #2649

Merged
deepcoldy merged 1 commit into
masterfrom
test/cli-status-failure-branch
Oct 31, 2026
Merged

deepcoldy merged 1 commit into
masterfrom
test/cli-status-failure-branch

Conversation

@deepcoldy

Copy link
Copy Markdown
Owner

背景

#2644 把 cli-update-alias 的 PATH: '' 隔离换成非空桩目录(修 Bun 腿真跑 git pull 的 #2643)。复审时确认:改后 src/cli.ts 的「读取 git 状态失败」分支(git status --porcelain 自身非零退出)在全仓再无覆盖。本 PR 补上这条用例。

内容与复审过的提交逐字一致(#2644 合入后该提交晚了几分钟推到分支、未进 PR,这里在最新 master 上重提,delta 逐字节相同)。

改动(仅测试)

  • writeGitStub helper:在独立临时目录里写桩 git,status 走给定响应,其余子命令 exit 97 + 哨兵(防流程越过干净检查进入 pull/build)。
  • 新增用例:桩 git 对 status 向 stderr 输出哨兵并 exit 1 → 断言 CLI 报「读取 git 状态失败」、exit 1,且不进入 pull(STUB_UNEXPECTED 不出现)。
  • 两个桩目录各自 mkdtemp + afterAll 清理。

验证

  • bun test test/cli-update-alias.test.ts:3 pass;bunx vitest run 同文件:3 passed;tsc 通过。
  • 变异(均还原后确认 diff 干净):fail 桩 status 改 exit 0 干净 → 双腿红(流程进入 pull 被 unexpected 守卫咬);exit 0 + 脏行(走错分支)→ 双腿红;exit 1 不输出哨兵 → 双腿红(证明哨兵断言承重:区分「git 喷错」与「仅非零退出」)。

纯测试改动,无运行时影响。

🤖 Generated with Claude Code

复审指出:改用脏状态桩后,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
deepcoldy merged commit f308264 into master Oct 31, 2026
15 checks passed
@github-actions

Copy link
Copy Markdown

@deepcoldy 合入 master 后的 Midscene E2E 失败:Feishu live Midscene 失败。

这次运行覆盖 f308264…46bd9c50e(4 个提交),同批合入的还有 #2648 #2645 #2586,失败不一定由本 PR 引起。

用例 跑道 状态 失败信息
Gemini basic bot flow feishu-core-clis failed Replanned 20 times, exceeding the limit. Please configure a larger value for replanningCycleLimit (or use MIDSCENE_REPLANNING_CYCLE_LIMIT) to handle more complex tasks.
Codex prompt submission feishu-core-codex failed Node "feishu.waitForBotResponse" timed out after 300000ms.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

🚀 Released in v3.56.0

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.

1 participant