2024-09-08 15:28:22: merge [master:33b4e2d9651dc592eae18e258984b11b35cc0a5e];
This commit is contained in:
1 parent
6f45b1861f
commit
02df1a6546
36 files changed
+653
-3262
No files matched your search
@@ -0,0 +1,52 @@
|
||||
package tests_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/stretchr/testify/suite"
|
||||
"github.com/txix-open/isp-kit/dbx"
|
||||
"github.com/txix-open/isp-kit/grpc/client"
|
||||
"github.com/txix-open/isp-kit/test"
|
||||
"github.com/txix-open/isp-kit/test/dbt"
|
||||
"github.com/txix-open/isp-kit/test/fake"
|
||||
"github.com/txix-open/isp-kit/test/grpct"
|
||||
"isp-system-service/assembly"
|
||||
"isp-system-service/conf"
|
||||
"isp-system-service/service/baseline"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestBaselineSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
suite.Run(t, &BaselineSuite{})
|
||||
}
|
||||
|
||||
type BaselineSuite struct {
|
||||
suite.Suite
|
||||
test *test.Test
|
||||
testDb *dbt.TestDb
|
||||
baseline baseline.Service
|
||||
api *client.Client
|
||||
}
|
||||
|
||||
func (s *BaselineSuite) SetupSuite() {
|
||||
s.test, _ = test.New(s.T())
|
||||
|
||||
s.testDb = dbt.New(s.test, dbx.WithMigrationRunner("../migrations", s.test.Logger()))
|
||||
|
||||
locator := assembly.NewLocator(s.testDb, s.test.Logger())
|
||||
config := locator.Config(conf.Remote{
|
||||
Baseline: conf.Baseline{
|
||||
InitialAdminUiToken: fake.It[string](),
|
||||
},
|
||||
})
|
||||
s.baseline = config.Baseline
|
||||
_, s.api = grpct.TestServer(s.test, config.Handler)
|
||||
}
|
||||
|
||||
func (s *BaselineSuite) TestBaselineSuccess() {
|
||||
err := s.baseline.Do(context.Background())
|
||||
s.Require().NoError(err)
|
||||
|
||||
err = s.baseline.Do(context.Background())
|
||||
s.Require().NoError(err)
|
||||
}
|
||||
Reference in new issue
Block a user