chore: add tests for migrator

This commit is contained in:
Steven
2024-08-26 08:41:26 +08:00
parent 96b9269cd3
commit 525223c261
8 changed files with 147 additions and 108 deletions

View File

@@ -0,0 +1,17 @@
package teststore
import (
"context"
"testing"
"github.com/stretchr/testify/require"
)
func TestGetCurrentSchemaVersion(t *testing.T) {
ctx := context.Background()
ts := NewTestingStore(ctx, t)
currentSchemaVersion, err := ts.GetCurrentSchemaVersion()
require.NoError(t, err)
require.Equal(t, "0.22.4", currentSchemaVersion)
}

View File

@@ -32,7 +32,7 @@ func GetTestingProfile(t *testing.T) *profile.Profile {
// Get a temporary directory for the test data.
dir := t.TempDir()
mode := "dev"
mode := "prod"
port := getUnusedPort()
driver := getDriverFromEnv()
dsn := os.Getenv("DSN")