test: 测试库改为模板克隆并纳入完整租号 e2e

每个包不再重复 DROP+迁移,清空改用 DELETE 并重置自增,go test ./... 从约 6 分钟降到十几秒。租号全链路改走 NewTestDB,去掉依赖额外 DSN 才会跑的过渡测试。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
yml2213
2026-09-10 15:46:18 +08:00
co-authored by Cursor
parent cbd5412315
commit 47ceb53c09
11 changed files with 456 additions and 275 deletions
+1 -1
View File
@@ -43,4 +43,4 @@ GRANT ALL PRIVILEGES ON \`${pattern}\_%\`.* TO '${app_user}'@'%';
FLUSH PRIVILEGES;
SQL
printf '测试库授权已就绪。测试运行时会自动重建各自的库:%s_<包名>\n' "${base_database}"
printf '测试库授权已就绪。测试运行时会维护模板库 %s__template,并按包克隆为 %s_<包名>\n' "${base_database}" "${base_database}"