Chore: Make Cfg field private in SQLStore (#85593)

* make cfg private in sqlstore

* fix db init in tests

* fix case

* fix folder test init

* fix imports

* make another Cfg private

* remove another Cfg

* remove unused variable

* use store cfg, it has side-effects

* fix mutated cfg in tests
This commit is contained in:
Serge Zaitsev
2024-04-24 10:38:40 +02:00
committed by GitHub
parent f6e472f879
commit 522a98c126
50 changed files with 325 additions and 344 deletions
@@ -31,8 +31,8 @@ func TestIntegrationTempUserCommandsAndQueries(t *testing.T) {
Status: tempuser.TmpUserInvitePending,
}
setup := func(t *testing.T) {
db := db.InitTestDB(t)
store = &xormStore{db: db, cfg: db.Cfg}
db, cfg := db.InitTestDBWithCfg(t)
store = &xormStore{db: db, cfg: cfg}
tempUser, err = store.CreateTempUser(context.Background(), &cmd)
require.Nil(t, err)
}
@@ -112,8 +112,8 @@ func TestIntegrationTempUserCommandsAndQueries(t *testing.T) {
Status: tempuser.TmpUserEmailUpdateStarted,
InvitedByUserID: userID,
}
db := db.InitTestDB(t)
store = &xormStore{db: db, cfg: db.Cfg}
db, cfg := db.InitTestDBWithCfg(t)
store = &xormStore{db: db, cfg: cfg}
for i := 0; i < verifications; i++ {
tempUser, err = store.CreateTempUser(context.Background(), &cmd)
@@ -152,8 +152,8 @@ func TestIntegrationTempUserCommandsAndQueries(t *testing.T) {
Status: tempuser.TmpUserEmailUpdateStarted,
InvitedByUserID: 99,
}
db := db.InitTestDB(t)
store = &xormStore{db: db, cfg: db.Cfg}
db, cfg := db.InitTestDBWithCfg(t)
store = &xormStore{db: db, cfg: cfg}
tempUser, err = store.CreateTempUser(context.Background(), &cmd)
require.Nil(t, err)