diff options
author | Pavlo Strokov <pstrokov@gitlab.com> | 2021-08-19 15:39:46 +0300 |
---|---|---|
committer | Pavlo Strokov <pstrokov@gitlab.com> | 2021-08-19 15:45:34 +0300 |
commit | 89df05730d113bd81091f91e8fae7c411cb731ca (patch) | |
tree | a872c82c0d526f2edcdfc2939e48fba77e13685b /cmd | |
parent | a4cc03f350f66527198044e1627b8ef9e1797551 (diff) |
test: Rename GetDB to NewDB
As now we create a new database on each call of the
glsql.GetDB and do not re-use existing database created
on a first call of the function we rename the function.
NewDB is self-explanatory.
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/praefect/subcmd_accept_dataloss_test.go | 2 | ||||
-rw-r--r-- | cmd/praefect/subcmd_dataloss_test.go | 2 | ||||
-rw-r--r-- | cmd/praefect/subcmd_set_replication_factor_test.go | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/cmd/praefect/subcmd_accept_dataloss_test.go b/cmd/praefect/subcmd_accept_dataloss_test.go index 7316d599c..ef5187227 100644 --- a/cmd/praefect/subcmd_accept_dataloss_test.go +++ b/cmd/praefect/subcmd_accept_dataloss_test.go @@ -35,7 +35,7 @@ func TestAcceptDatalossSubcommand(t *testing.T) { ctx, cancel := testhelper.Context() defer cancel() - db := glsql.GetDB(t) + db := glsql.NewDB(t) rs := datastore.NewPostgresRepositoryStore(db, conf.StorageNames()) startingGenerations := map[string]int{st1: 1, st2: 0, st3: datastore.GenerationUnknown} diff --git a/cmd/praefect/subcmd_dataloss_test.go b/cmd/praefect/subcmd_dataloss_test.go index 6f033dcef..8fce062ce 100644 --- a/cmd/praefect/subcmd_dataloss_test.go +++ b/cmd/praefect/subcmd_dataloss_test.go @@ -40,7 +40,7 @@ func TestDatalossSubcommand(t *testing.T) { }, } - tx := glsql.GetDB(t).Begin(t) + tx := glsql.NewDB(t).Begin(t) defer tx.Rollback(t) ctx, cancel := testhelper.Context() diff --git a/cmd/praefect/subcmd_set_replication_factor_test.go b/cmd/praefect/subcmd_set_replication_factor_test.go index 8a8139f28..b2eaa0226 100644 --- a/cmd/praefect/subcmd_set_replication_factor_test.go +++ b/cmd/praefect/subcmd_set_replication_factor_test.go @@ -17,7 +17,7 @@ import ( ) func TestSetReplicationFactorSubcommand(t *testing.T) { - db := glsql.GetDB(t) + db := glsql.NewDB(t) for _, tc := range []struct { desc string |