Repository navigation
test: 删除反向拆库链,使用真实历史迁移夹具 - #250
Merged
Merged
Conversation
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
changed the base branch from
codex/deduplicate-execution-authority
to
main
October 5, 2026 03:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题与改动
旧迁移测试先创建较新数据库,再依靠长链反向 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 行。
验证
removeSchemaV*ForTest*定义和调用均为零;改动仅涉及internal/store/*_test.go。依赖 #249,后续 CI 重复步骤与架构状态文档将单独提交。