test: record v0.25 remote transaction and MySQL acceptance

This commit is contained in:
2026-09-26 20:32:23 +08:00
parent 7a177744ab
commit 6a95cad184
4 changed files with 325 additions and 0 deletions

View File

@@ -9,6 +9,7 @@
- `go vet ./...`、`go build ./...`:通过。
- `go test -race ./database -run '^TestInTxCancellation' -count=20`:通过,包含 20 × 128 次取消与回滚竞争检查。
- `go run ./examples/transactions`:六种结果通过,包括“已保存但提交报错”时不清理文件的演示决策;示例没有真实文件删除。
- checked-in managedService 的生成检查、race 和根目录 build 通过。
| 场景 | 验证结果 |
| --- | --- |
@@ -61,3 +62,17 @@ go test ./database -run '^$' -bench '^BenchmarkInTx$' -benchmem -benchtime=300ms
Outcome 只属于当前受管理事务;回调不得自己提交/回滚、执行隐式提交 SQL、把事务交给其他 goroutine。其他连接、独立事务、非事务表、文件和第三方系统的副作用由业务负责。
标准库异步回滚不公开的驱动原因无法还原。只拿到 ErrTxDone 时保守返回 Unknown;直接观察到的回滚失败全部保留。panic/Goexit 保持原有传播,没有普通返回值可携带回滚原因。返回错误的文本/具体最外层类型有变化,调用方使用 errors.Is/As;GORM 自己的 Transaction 不属于本次接口。
## 远程版本验收
`v0.25.0-preview` 标签固定在 `7a177744ab2bb85f23efc0ec267fd905d349bd4b`,checksum 为 `h1:R1rDYtPBWRfRNHY2Px1gZF3/xpit6Pttd7AvIbMJpKs=`。
- 空 module 缓存安装 CLI,固定远程依赖、无本地 replace,77 项检查通过,耗时 71.93 秒。9 组生成消费者、下载模块 database/config/httpc/copyx/logx/cors/app 的 race、事务示例、生成检查与业务文件保留通过。见 [transactionRemote.json](transactionRemote.json)。
- 独立空缓存下载同一版本,53 条 MySQL 测试记录(含子用例)通过,耗时 28.49 秒。真实 TLS 数据库提交/回滚后的确认丢失、GORM、生成项目与后台 drain 验收通过;独立容器和临时资源已清理。见 [transactionMySQLRemote.json](transactionMySQLRemote.json)。
```sh
python3 scripts/verifyManagedRelease.py --version v0.25.0-preview --report reports/transactionRemote.json
python3 scripts/verifyConnector.py --version v0.25.0-preview --gorm --phases --report reports/transactionMySQLRemote.json
```
发布标签不随验收记录提交移动。