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
+4 -4
View File
@@ -14,13 +14,13 @@ func TestIntegrationGetOrCreateOrg(t *testing.T) {
if testing.Short() {
t.Skip("Skipping integration test in short mode")
}
ss := InitTestDB(t)
ss, _ := InitTestDB(t)
err := ss.WithNewDbSession(context.Background(), func(sess *DBSession) error {
// Create the org only:
ss.Cfg.AutoAssignOrg = true
ss.Cfg.DisableInitAdminCreation = true
ss.Cfg.AutoAssignOrgId = 1
ss.cfg.AutoAssignOrg = true
ss.cfg.DisableInitAdminCreation = true
ss.cfg.AutoAssignOrgId = 1
createdOrgID, err := ss.getOrCreateOrg(sess, mainOrgName)
require.NoError(t, err)
require.Equal(t, int64(1), createdOrgID)