Skip to content

test: 删除反向拆库链,使用真实历史迁移夹具 - #250

Merged
Qiyuanqiii merged 1 commit into
mainfrom
codex/remove-reverse-migration-fixtures
Oct 5, 2026
Merged

Qiyuanqiii merged 1 commit into
mainfrom
codex/remove-reverse-migration-fixtures

Conversation

@Qiyuanqiii

Copy link
Copy Markdown
Member

问题与改动

旧迁移测试先创建较新数据库,再依靠长链反向 DDL 模拟历史版本;每次新增迁移都要维护拆表、拆列和触发器恢复。删除全部 128 个反向 DDL 函数及 2 个旧入口,改用已有真实历史 prefix 建库 helper。简单种子直接写入历史库;复杂种子通过测试专用导入器复制可表达的数据,保留 rowid、约束及原有私有历史拒绝条件。

导入只在目标事务中暂时停用并原样恢复插入触发器,失败时整体回滚。迁移 ledger 由真实 prefix 生成,生产迁移没有改动。保留 v166 的真实历史 gate 验证、v170 的独立 raw oracle 和原升级后的行为断言;删除 3 个仅为退役拆库链服务的自测。

真实历史约束还暴露了旧 Sandbox 夹具把 v2 candidate 放进 v131 之前数据库的问题。现在专用种子 Store 创建真正的 v1 candidate,并通过原 writer 同步生成对应 operation fingerprint 和事件,恢复真实旧版本语义。

108 个测试文件,净删 2,995 行。

验证

  • 共 93 个独立定向用例通过:受影响迁移、历史 prefix 保真、私有历史拒绝、导入失败回滚及 Sandbox v1 绑定保真。
  • 首轮 18 个 Sandbox 用例因上述真实旧表约束失败;修复后针对失败项及受影响的 v132 用例补验通过,其他通过项没有重复跑。
  • 代码中 removeSchemaV*ForTest* 定义和调用均为零;改动仅涉及 internal/store/*_test.go。

依赖 #249,后续 CI 重复步骤与架构状态文档将单独提交。

Build upgrade inputs from real migration prefixes, import compatible seed data,
and use v1 Sandbox candidates for historical fixtures.

Co-authored-by: Codex <codex@openai.com>
@Qiyuanqiii
Qiyuanqiii changed the base branch from codex/deduplicate-execution-authority to main October 5, 2026 03:50
@Qiyuanqiii
Qiyuanqiii merged commit 79e5938 into main Oct 5, 2026
19 checks passed
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