mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-29 23:15:28 +08:00
issue: #33285 - register streaming coord service into datacoord. - add new streaming node role. - add global static switch to enable streaming service or not. Signed-off-by: chyezh <chyezh@outlook.com>
36 lines
732 B
Go
36 lines
732 B
Go
package resource
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
clientv3 "go.etcd.io/etcd/client/v3"
|
|
|
|
"github.com/milvus-io/milvus/internal/mocks"
|
|
)
|
|
|
|
func TestInit(t *testing.T) {
|
|
assert.Panics(t, func() {
|
|
Init()
|
|
})
|
|
assert.Panics(t, func() {
|
|
Init(OptETCD(&clientv3.Client{}))
|
|
})
|
|
assert.Panics(t, func() {
|
|
Init(OptRootCoordClient(mocks.NewMockRootCoordClient(t)))
|
|
})
|
|
Init(
|
|
OptETCD(&clientv3.Client{}),
|
|
OptRootCoordClient(mocks.NewMockRootCoordClient(t)),
|
|
OptDataCoordClient(mocks.NewMockDataCoordClient(t)),
|
|
)
|
|
|
|
assert.NotNil(t, Resource().TSOAllocator())
|
|
assert.NotNil(t, Resource().ETCD())
|
|
assert.NotNil(t, Resource().RootCoordClient())
|
|
}
|
|
|
|
func TestInitForTest(t *testing.T) {
|
|
InitForTest()
|
|
}
|