fix(e2e): align confirm generation response assertion with BatchGenerationTaskResponse #1366

Merged
auto-approve-bot merged 1 commits from fix/e2e-confirm-generation-response-assertion into develop 2026-08-14 13:41:00 +08:00
Owner

Problem

CI Run #29700 Staging E2E Tests 失败:

[chromium] › core-generation.spec.ts:55:3 › Core generation flow › walks through 7-step wizard and starts generation
Error: expect(received).toBeTruthy()
Received: undefined
  262 |       expect(genData.plan_id).toBeTruthy()

Root Cause

E2E 测试中确认生成 API 的响应断言使用了 plan_idgeneration_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 存在
## Problem CI Run #29700 Staging E2E Tests 失败: ``` [chromium] › core-generation.spec.ts:55:3 › Core generation flow › walks through 7-step wizard and starts generation Error: expect(received).toBeTruthy() Received: undefined 262 | expect(genData.plan_id).toBeTruthy() ``` ## 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 存在
xiaoxia added 1 commit 2026-08-14 13:35:35 +08:00
fix(e2e): align confirm generation response assertion with BatchGenerationTaskResponse
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 36s
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 1m14s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Successful in 36s
AI Code Review / AI Code Review (pull_request) Successful in 1m22s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m28s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 1m28s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 1m39s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 1m4s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 1m44s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 1m50s
CI/CD Pipeline / Validate - Code Quality (pull_request) Successful in 4m40s
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / CI Gate (pull_request) Successful in 6s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 51s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 58s
cd2c0d5fb4
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.
Collaborator

【阻塞级判定】

  • 是否存在阻塞级问题:否
  • 阻塞级问题数量:0 个

📊 审查概览

  • 整体评价:通过
  • 建议级问题数量:0 个

🔴 阻塞级问题(必须修复)

💡 改进建议(不阻塞合并)

良好实践

  • 防御性编程:在访问 items[0] 之前先使用 toBeGreaterThan(0) 检查数组长度,有效避免了空数组导致的边界错误。
  • 测试同步更新:及时更新了 E2E 测试用例以匹配后端 API 响应结构的变化(从单一对象改为包含 items 数组的结构),保证了测试的有效性。

🤖 由 AI 代码审查机器人自动生成 | 2026-08-14 05:36:58 | 模型:

### 【阻塞级判定】 - 是否存在阻塞级问题:否 - 阻塞级问题数量:0 个 ### 📊 审查概览 - 整体评价:通过 - 建议级问题数量:0 个 ### 🔴 阻塞级问题(必须修复) 无 ### 💡 改进建议(不阻塞合并) 无 ### ✅ 良好实践 - **防御性编程**:在访问 `items[0]` 之前先使用 `toBeGreaterThan(0)` 检查数组长度,有效避免了空数组导致的边界错误。 - **测试同步更新**:及时更新了 E2E 测试用例以匹配后端 API 响应结构的变化(从单一对象改为包含 `items` 数组的结构),保证了测试的有效性。 --- <sub>🤖 由 AI 代码审查机器人自动生成 | 2026-08-14 05:36:58 | 模型: </sub> <!-- AI_CODE_REVIEW_AUTO_COMMENT -->

🚀 预览环境已部署

项目 详情
PR号 #1366
预览链接 https://pr-1366.preview.xiaoxiajianji.com
API环境 staging

💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。

🔄 每次提交新代码后预览环境会自动更新。

🗑️ PR 关闭或合并后,预览环境会自动清理。

🚀 **预览环境已部署** | 项目 | 详情 | |------|------| | PR号 | #1366 | | 预览链接 | [https://pr-1366.preview.xiaoxiajianji.com](https://pr-1366.preview.xiaoxiajianji.com) | | API环境 | staging | > 💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。 > > 🔄 每次提交新代码后预览环境会自动更新。 > > 🗑️ PR 关闭或合并后,预览环境会自动清理。
auto-approve-bot approved these changes 2026-08-14 13:37:21 +08:00
auto-approve-bot left a comment
Collaborator

CI全绿,自动审批通过。

CI全绿,自动审批通过。
auto-approve-bot approved these changes 2026-08-14 13:37:21 +08:00
auto-approve-bot left a comment
Collaborator

CI全绿,自动审批通过。

CI全绿,自动审批通过。
auto-approve-bot merged commit 00348a2154 into develop 2026-08-14 13:41:00 +08:00
auto-approve-bot deleted branch fix/e2e-confirm-generation-response-assertion 2026-08-14 13:41:00 +08:00

🗑️ 预览环境已清理

PR #1366 已关闭或合并,对应的预览环境已被清理。

如有需要,可以重新打开 PR 来重新生成预览环境。

🗑️ **预览环境已清理** PR #1366 已关闭或合并,对应的预览环境已被清理。 > 如有需要,可以重新打开 PR 来重新生成预览环境。
Sign in to join this conversation.