refactor: migrate 'flowutils' to 'must' helpers
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"git.offline-twitter.com/offline-labs/gas-stack/pkg/db"
|
||||
"git.offline-twitter.com/offline-labs/gas-stack/pkg/flowutils"
|
||||
"git.offline-twitter.com/offline-labs/gas-stack/pkg/must"
|
||||
"git.offline-twitter.com/offline-labs/gas-stack/pkg/schema"
|
||||
)
|
||||
|
||||
@@ -57,7 +57,7 @@ func TestVerifyCorrectMigration(t *testing.T) {
|
||||
alter table t1 add column data3 integer;
|
||||
`
|
||||
db2Config := db.Init(&baseSchema, &[]string{migration})
|
||||
db2 := flowutils.Must(db2Config.Create(":memory:"))
|
||||
db2 := must.Get(db2Config.Create(":memory:"))
|
||||
require.NoError(t, db2Config.CheckAndUpdateVersion(db2))
|
||||
db2Schema := schema.SchemaFromDB(db2)
|
||||
|
||||
@@ -77,7 +77,7 @@ func TestVerifyCorrectMigration(t *testing.T) {
|
||||
`
|
||||
|
||||
db2Config := db.Init(&baseSchema, &[]string{migration1, migration2})
|
||||
db2 := flowutils.Must(db2Config.Create(":memory:"))
|
||||
db2 := must.Get(db2Config.Create(":memory:"))
|
||||
require.NoError(t, db2Config.CheckAndUpdateVersion(db2))
|
||||
db2Schema := schema.SchemaFromDB(db2)
|
||||
|
||||
@@ -93,7 +93,7 @@ func TestIncorrectMigrations(t *testing.T) {
|
||||
|
||||
t.Run("missing migration", func(t *testing.T) {
|
||||
db2Config := db.Init(&baseSchema, &[]string{})
|
||||
db2 := flowutils.Must(db2Config.Create(":memory:"))
|
||||
db2 := must.Get(db2Config.Create(":memory:"))
|
||||
require.NoError(t, db2Config.CheckAndUpdateVersion(db2))
|
||||
db2Schema := schema.SchemaFromDB(db2)
|
||||
|
||||
@@ -114,7 +114,7 @@ func TestIncorrectMigrations(t *testing.T) {
|
||||
rowid integer primary key
|
||||
);
|
||||
`})
|
||||
db2 := flowutils.Must(db2Config.Create(":memory:"))
|
||||
db2 := must.Get(db2Config.Create(":memory:"))
|
||||
require.NoError(t, db2Config.CheckAndUpdateVersion(db2))
|
||||
db2Schema := schema.SchemaFromDB(db2)
|
||||
|
||||
@@ -136,7 +136,7 @@ func TestIncorrectMigrations(t *testing.T) {
|
||||
);
|
||||
alter table t1 add column data3 text;
|
||||
`})
|
||||
db2 := flowutils.Must(db2Config.Create(":memory:"))
|
||||
db2 := must.Get(db2Config.Create(":memory:"))
|
||||
require.NoError(t, db2Config.CheckAndUpdateVersion(db2))
|
||||
db2Schema := schema.SchemaFromDB(db2)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user