refactor: align framework cleanup with new bootstrap flow
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/break/junhong_cmp_fiber/tests/testutils"
|
||||
"github.com/golang-migrate/migrate/v4"
|
||||
_ "github.com/golang-migrate/migrate/v4/database/postgres"
|
||||
_ "github.com/golang-migrate/migrate/v4/source/file"
|
||||
@@ -49,7 +50,7 @@ func TestMigration_UpAndDown(t *testing.T) {
|
||||
require.NoError(t, err, "获取数据库连接字符串失败")
|
||||
|
||||
// 应用数据库迁移
|
||||
migrationsPath := getMigrationsPath(t)
|
||||
migrationsPath := testutils.GetMigrationsPath()
|
||||
m, err := migrate.New(
|
||||
fmt.Sprintf("file://%s", migrationsPath),
|
||||
connStr,
|
||||
@@ -135,7 +136,7 @@ func TestMigration_UpAndDown(t *testing.T) {
|
||||
// TestMigration_NoForeignKeys 验证迁移脚本不包含外键约束
|
||||
func TestMigration_NoForeignKeys(t *testing.T) {
|
||||
// 获取迁移目录
|
||||
migrationsPath := getMigrationsPath(t)
|
||||
migrationsPath := testutils.GetMigrationsPath()
|
||||
|
||||
// 读取所有迁移文件
|
||||
files, err := filepath.Glob(filepath.Join(migrationsPath, "*.up.sql"))
|
||||
@@ -187,7 +188,7 @@ func TestMigration_SoftDeleteSupport(t *testing.T) {
|
||||
require.NoError(t, err, "获取数据库连接字符串失败")
|
||||
|
||||
// 应用迁移
|
||||
migrationsPath := getMigrationsPath(t)
|
||||
migrationsPath := testutils.GetMigrationsPath()
|
||||
m, err := migrate.New(
|
||||
fmt.Sprintf("file://%s", migrationsPath),
|
||||
connStr,
|
||||
|
||||
Reference in New Issue
Block a user