fix(e2e): align confirm generation response assertion with BatchGenerationTaskResponse #1366
Reference in New Issue
Block a user
Delete Branch "fix/e2e-confirm-generation-response-assertion"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
CI Run #29700 Staging E2E Tests 失败:
Root Cause
E2E 测试中确认生成 API 的响应断言使用了
plan_id和generation_task_id字段,但实际 API(POST /tasks/{task_id}/confirm)返回的是BatchGenerationTaskResponse,结构为{ items: GenerationTaskResponse[], total: number }。plan_id不存在于响应中,导致expect(undefined).toBeTruthy()失败。Fix
更新 E2E 断言以匹配实际的
BatchGenerationTaskResponse结构:expect(genData.items.length).toBeGreaterThan(0)验证有返回任务expect(genData.items[0].id).toBeTruthy()验证任务 ID 存在The confirm generation API (POST /tasks/{task_id}/confirm) returns BatchGenerationTaskResponse with items[] and total, not plan_id / generation_task_id. Update the E2E assertion to match the actual response schema. Fixes CI Run #29700 Staging E2E Tests failure.【阻塞级判定】
📊 审查概览
🔴 阻塞级问题(必须修复)
无
💡 改进建议(不阻塞合并)
无
✅ 良好实践
items[0]之前先使用toBeGreaterThan(0)检查数组长度,有效避免了空数组导致的边界错误。items数组的结构),保证了测试的有效性。🤖 由 AI 代码审查机器人自动生成 | 2026-08-14 05:36:58 | 模型:
🚀 预览环境已部署
CI全绿,自动审批通过。
CI全绿,自动审批通过。
🗑️ 预览环境已清理
PR #1366 已关闭或合并,对应的预览环境已被清理。