test(report): register personal reports in database fixture
Staging Backend Quality Gate / validate (pull_request) Successful in 15m5s
Staging Backend Quality Gate / publish (pull_request) Has been skipped

This commit is contained in:
Jesse
2026-08-06 13:36:23 +08:00
parent 58894b201b
commit 94f051f4d0
2 changed files with 18 additions and 0 deletions
+16
View File
@@ -2192,3 +2192,19 @@
- 相关记录:BUG-014、BUG-125
- 复发自:BUG-014
- 修复版本:本次个人报告 staging 发布提交
## BUG-127 | 个人报告迁移成功后 self-hosted 精确表清单仍是旧值
- 状态:resolvedlocalpending 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 发布提交
@@ -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",