MSP-5093 remove global varibale

This commit is contained in:
komissarovyv committed 2025-03-26 11:28:43 +03:00
1 parent 055921d711
commit 46fc51275e
8 files changed
+23 -19

No files matched your search

+2 -1
View File
@@ -3,6 +3,7 @@ package tests_test
import (
"context"
"testing"
"time"
"github.com/stretchr/testify/suite"
"github.com/txix-open/isp-kit/dbx"
@@ -65,7 +66,7 @@ func (t *AuditSuite) SetupTest() {
},
}
cfg := assembly.NewLocator(testInstance.Logger(), httpcli.New(), t.db).
Config(context.Background(), emptyLdap, remote)
Config(context.Background(), emptyLdap, remote, time.Minute)
server, apiCli := grpct.TestServer(testInstance, cfg.Handler)
t.grpcCli = apiCli
+1 -1
View File
@@ -65,7 +65,7 @@ func (s *AuthTestSuite) SetupTest() {
},
}
cfg := assembly.NewLocator(testInstance.Logger(), s.httpCli, s.db).
Config(context.Background(), emptyLdap, remote)
Config(context.Background(), emptyLdap, remote, time.Minute)
server, apiCli := grpct.TestServer(testInstance, cfg.Handler)
s.grpcCli = apiCli
+2 -1
View File
@@ -3,6 +3,7 @@ package tests_test
import (
"context"
"testing"
"time"
"github.com/stretchr/testify/suite"
"github.com/txix-open/isp-kit/dbx"
@@ -39,7 +40,7 @@ func (s *CustomizationTestSuite) SetupTest() {
ExpireSec: 0,
}
cfg := assembly.NewLocator(testInstance.Logger(), nil, s.db).
Config(context.Background(), emptyLdap, remote)
Config(context.Background(), emptyLdap, remote, time.Minute)
server, apiCli := grpct.TestServer(testInstance, cfg.Handler)
s.grpcCli = apiCli
+6 -6
View File
@@ -1,6 +1,7 @@
package tests_test
import (
"msp-admin-service/service/inactive_worker"
"testing"
"time"
@@ -12,7 +13,6 @@ import (
"msp-admin-service/conf"
"msp-admin-service/entity"
"msp-admin-service/repository"
"msp-admin-service/service/inactive_worker"
)
func TestInactiveWorker(t *testing.T) {
@@ -42,14 +42,14 @@ func TestInactiveWorker(t *testing.T) {
Config(t.Context(), emptyLdap, conf.Remote{
BlockInactiveWorker: conf.BlockInactiveWorker{
DaysThreshold: 1,
RunIntervalInMinutes: 60,
RunIntervalInMinutes: 1,
},
})
}, 500*time.Millisecond)
bgjobCli := bgjobx.NewClient(db, test.Logger())
assembly.JobPollInterval = 300 * time.Millisecond
err := bgjobCli.Upgrade(t.Context(), config.BgJobCfg)
err := inactive_worker.EnqueueSeedJob(t.Context(), bgjobCli)
require.NoError(err)
err = inactive_worker.EnqueueSeedJob(t.Context(), bgjobCli)
err = bgjobCli.Upgrade(t.Context(), config.BgJobCfg)
require.NoError(err)
time.Sleep(5 * time.Second)
+1 -1
View File
@@ -40,7 +40,7 @@ func (s *SecureSuite) SetupTest() {
ExpireSec: 3600,
}
cfg := assembly.NewLocator(s.test.Logger(), httpCli, s.db).
Config(context.Background(), emptyLdap, remote)
Config(context.Background(), emptyLdap, remote, time.Minute)
server, apiCli := grpct.TestServer(s.test, cfg.Handler)
s.test.T().Cleanup(func() {
+1 -1
View File
@@ -54,7 +54,7 @@ func (s *UserTestSuite) SetupTest() {
ExpireSec: 0,
}
cfg := assembly.NewLocator(testInstance.Logger(), s.httpCli, s.db).
Config(context.Background(), emptyLdap, remote)
Config(context.Background(), emptyLdap, remote, time.Minute)
server, apiCli := grpct.TestServer(testInstance, cfg.Handler)
s.grpcCli = apiCli