From 94f051f4d02e2ed27c0dffa0a4777d7f77e9e672 Mon Sep 17 00:00:00 2001 From: Jesse Date: Thu, 6 Aug 2026 13:36:23 +0800 Subject: [PATCH] test(report): register personal reports in database fixture --- docs/BUG_HISTORY.md | 16 ++++++++++++++++ frontend/tests/database-local-business.test.ts | 2 ++ 2 files changed, 18 insertions(+) diff --git a/docs/BUG_HISTORY.md b/docs/BUG_HISTORY.md index e3f32f31..ddf9994b 100644 --- a/docs/BUG_HISTORY.md +++ b/docs/BUG_HISTORY.md @@ -2192,3 +2192,19 @@ - 相关记录:BUG-014、BUG-125 - 复发自:BUG-014 - 修复版本:本次个人报告 staging 发布提交 + +## BUG-127 | 个人报告迁移成功后 self-hosted 精确表清单仍是旧值 + +- 状态:resolved(local,pending quality-gate rerun) +- 首次发现:2026-08-06 +- 最近更新:2026-08-06 +- 影响面:`frontend/tests/database-local-business.test.ts`、self-hosted PostgreSQL 全迁移验收、Gitea `Staging Backend Quality Gate` +- 用户现象:quality gate run `1456` 的 1409 项 frontend 测试中 1408 项通过;真实 PostgreSQL fixture 成功创建 `public.personal_reports` 后,精确表集合断言因预期值缺少该表而失败。 +- 触发条件:在完整 Docker/PostgreSQL runner 中应用全部迁移并枚举 `public` schema 表。 +- 根因:个人报告迁移契约覆盖了双迁移语义、RLS、权限和版本唯一性,但既有 self-hosted 全库精确表清单没有同步新增 `personal_reports`;本机缺少 Docker CLI,无法执行该 fixture,问题由远端完整 runner 捕获。 +- 修复:在 self-hosted 全迁移测试中显式断言 `20260806000000_personal_reports.sql` 被应用,并将 `personal_reports` 按字典序加入精确表清单;不删除真实表、不放宽集合比较。 +- 验证:静态 personal-report migration tests 继续通过;真实 PostgreSQL fixture 和完整 frontend suite 待下一次 Gitea quality gate 复验。 +- 防复发:新增 self-hosted 业务表时必须同时更新全迁移 applied ledger 和精确 `public` 表集合;本地没有 Docker 时必须依赖并等待完整远端数据库门禁,不能仅凭迁移文本测试宣称数据库全绿。 +- 相关记录:BUG-126 +- 复发自:无 +- 修复版本:本次个人报告 staging 发布提交 diff --git a/frontend/tests/database-local-business.test.ts b/frontend/tests/database-local-business.test.ts index 50eb4464..81d49ddd 100644 --- a/frontend/tests/database-local-business.test.ts +++ b/frontend/tests/database-local-business.test.ts @@ -38,6 +38,7 @@ test("local PostgreSQL applies the reviewed business schema and serves authentic assert.match(migration.stdout, /applied 20260805010000_reconcile_admin_redemption_audit\.sql/); assert.match(migration.stdout, /applied 20260805020000_reconcile_payment_admin_schema\.sql/); assert.match(migration.stdout, /applied 20260805030000_reconcile_rectification_v4_conversational_turns\.sql/); + assert.match(migration.stdout, /applied 20260806000000_personal_reports\.sql/); assert.equal( fixture.psql(` @@ -118,6 +119,7 @@ test("local PostgreSQL applies the reviewed business schema and serves authentic "epay_settings", "payment_orders", "payment_packages", + "personal_reports", "profiles", "redemption_codes", "synastry_reports",