Skip to content

fix(ci): 席位队列被取消时失败通知也省略未运行的飞书用例 - #2606

Merged
deepcoldy merged 1 commit into
masterfrom
ci/midscene-notify-feishu-ran
Oct 30, 2026
Merged

deepcoldy merged 1 commit into
masterfrom
ci/midscene-notify-feishu-ran

Conversation

@deepcoldy

Copy link
Copy Markdown
Owner

改了什么

#2595 用 env.QUEUE_RESULT !== 'failure' 判断飞书 job 是否真正启动,从而决定失败通知是否逐条列出 not-run 用例。这个判据只覆盖了「等满席位超时」一种「飞书没跑」。

本 PR:

  • 新增纯函数 feishuJobRan(queueResult),把 main() 里不可单测的环境变量映射抽出来:
    • failure(等满 290 分钟席位超时)和 cancelled(运行在排队等待期间被整体取消,飞书 job 因 needs: feishu-queue 一并 skipped)都算「没启动」→ 通知不列 not-run 用例;
    • success 正常列出;
    • undefined / skipped 等没见过的值保留列出,避免因异常结果把可能有用的行静默藏掉(fail-safe 方向)。
  • main 改为调用该函数。
  • 给 problemCases 在 fix(ci): 席位超时的失败通知不再刷屏列出未运行用例 #2595 新增的 options 参数补 JSDoc(与文件内其他导出注解一致)。
  • 补测试:覆盖 failure/cancelled 不列、success/undefined/skipped 列出,以及与 problemCases 串起来的端到端结果。

为什么

cancelled 这条路径当前不可达:队列 job 被 cancelled 只可能来自整个 workflow run 被取消,那时 midscene-report 是 skipped,通知 job 拿不到 manifest,cases 本来就空。但用 failure/cancelled 两个「确定没启动」的取值做判据,比「除了 failure 都算跑了」更贴变量语义,也防住未来 notify job 触发条件变化后的同类刷屏。

影响面

只动 CI 失败通知脚本 scripts/midscene-notify-failure.mjs 和它的单测,不动 src/、不动 workflow、不影响 daemon / CLI / 用户安装,零 breakchange。

验证

  • bun run test -- test/midscene-notify-failure.test.ts test/midscene-e2e-workflow.test.ts:18/18
  • bun test test/midscene-notify-failure.test.ts:9/9(bun 引擎)
  • bunx tsc --noEmit、tsc -p tsconfig.scripts.json、tsc -p tsconfig.test-mocks.json 均 0 错;bun run build exit 0;node --check 通过
  • 变异(两种错误判据)双引擎均精确 1 红:
    • 退回 !== 'failure':cancelled 断言红(vitest、bun 都红);
    • 改成 === 'success':undefined/skipped 的 fail-safe 断言红。

🤖 Generated with Claude Code

#2595 只用 QUEUE_RESULT !== 'failure' 判断飞书 job 是否启动。队列 job
为 cancelled(运行在排队等待期间被整体取消)同样意味着飞书 job 没起来,
极端形状下通知仍会逐条列出 not-run 用例。把判断抽成纯函数 feishuJobRan:
failure 和 cancelled 都算没启动而省略 not-run;success 正常列出;未知值
(undefined/skipped 等)保留列出,不因没见过的结果把可能有用的行藏掉。
顺带补上 problemCases 新增 options 参数的 JSDoc(#2595 评审 P3-1/P3-3)。

Co-Authored-By: Claude Code <[email protected]>
@deepcoldy
deepcoldy merged commit c2314ec into master Oct 30, 2026
15 checks passed
@github-actions

Copy link
Copy Markdown

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

这次运行覆盖 89a9cea…22d1c8d0b(20 个提交),同批合入的还有 #2546 #2556 #2589 #2591 #2545 #2538 #2595 #2596 #2597 #2581 #2539 #2598 #2515 #2536 #2575 #2366 #2544 #2593 #2603,失败不一定由本 PR 引起。

用例 跑道 状态 失败信息
Kimi basic bot flow feishu-core-clis failed waitFor timeout: Based on the screenshot, the middle column displays a welcome message "欢迎加入群组" (Welcome to the group) and system notifications about group creation and settings, rather than a list o…
Gemini basic bot flow feishu-core-clis failed waitFor timeout: Based on the screenshot, the main content area displays a topic conversation. I can see messages from "Gemini".
Codex DM chat mode replies inline and keeps one session feishu-core-dm-modes-codex failed Feishu Messenger chat list did not load after 4 attempts (URL: https://acn2e4mfbjx2.feishu.cn/next/messenger/, title: 消息 - 飞书). A login redirect means the saved storage state expired; a skeleton list…

@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