mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-11 09:46:26 +08:00
dadb02db75
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
110 lines
3.1 KiB
Go
110 lines
3.1 KiB
Go
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
|
|
// with the License. You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software distributed under the License
|
|
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
|
// or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
|
|
package querynode
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestParamTable_PulsarAddress(t *testing.T) {
|
|
address := Params.PulsarAddress
|
|
split := strings.Split(address, ":")
|
|
assert.Equal(t, "pulsar", split[0])
|
|
assert.Equal(t, "6650", split[len(split)-1])
|
|
}
|
|
|
|
func TestParamTable_QueryNode(t *testing.T) {
|
|
t.Run("Test id", func(t *testing.T) {
|
|
id := Params.QueryNodeID
|
|
assert.Contains(t, Params.QueryNodeIDList(), id)
|
|
})
|
|
|
|
t.Run("Test time tick channel", func(t *testing.T) {
|
|
ch := Params.QueryTimeTickChannelName
|
|
assert.Equal(t, ch, "queryTimeTick")
|
|
})
|
|
}
|
|
|
|
func TestParamTable_minio(t *testing.T) {
|
|
t.Run("Test endPoint", func(t *testing.T) {
|
|
endPoint := Params.MinioEndPoint
|
|
equal := endPoint == "localhost:9000" || endPoint == "minio:9000"
|
|
assert.Equal(t, equal, true)
|
|
})
|
|
|
|
t.Run("Test accessKeyID", func(t *testing.T) {
|
|
accessKeyID := Params.MinioAccessKeyID
|
|
assert.Equal(t, accessKeyID, "minioadmin")
|
|
})
|
|
|
|
t.Run("Test secretAccessKey", func(t *testing.T) {
|
|
secretAccessKey := Params.MinioSecretAccessKey
|
|
assert.Equal(t, secretAccessKey, "minioadmin")
|
|
})
|
|
|
|
t.Run("Test useSSL", func(t *testing.T) {
|
|
useSSL := Params.MinioUseSSLStr
|
|
assert.Equal(t, useSSL, false)
|
|
})
|
|
}
|
|
|
|
func TestParamTable_statsServiceTimeInterval(t *testing.T) {
|
|
interval := Params.StatsPublishInterval
|
|
assert.Equal(t, 1000, interval)
|
|
}
|
|
|
|
func TestParamTable_searchMsgStreamReceiveBufSize(t *testing.T) {
|
|
bufSize := Params.SearchReceiveBufSize
|
|
assert.Equal(t, int64(512), bufSize)
|
|
}
|
|
|
|
func TestParamTable_searchResultMsgStreamReceiveBufSize(t *testing.T) {
|
|
bufSize := Params.SearchResultReceiveBufSize
|
|
assert.Equal(t, int64(64), bufSize)
|
|
}
|
|
|
|
func TestParamTable_searchPulsarBufSize(t *testing.T) {
|
|
bufSize := Params.SearchPulsarBufSize
|
|
assert.Equal(t, int64(512), bufSize)
|
|
}
|
|
|
|
func TestParamTable_flowGraphMaxQueueLength(t *testing.T) {
|
|
length := Params.FlowGraphMaxQueueLength
|
|
assert.Equal(t, int32(1024), length)
|
|
}
|
|
|
|
func TestParamTable_flowGraphMaxParallelism(t *testing.T) {
|
|
maxParallelism := Params.FlowGraphMaxParallelism
|
|
assert.Equal(t, int32(1024), maxParallelism)
|
|
}
|
|
|
|
func TestParamTable_msgChannelSubName(t *testing.T) {
|
|
name := Params.MsgChannelSubName
|
|
expectName := fmt.Sprintf("queryNode-%d", Params.QueryNodeID)
|
|
assert.Equal(t, expectName, name)
|
|
}
|
|
|
|
func TestParamTable_statsChannelName(t *testing.T) {
|
|
name := Params.StatsChannelName
|
|
contains := strings.Contains(name, "query-node-stats")
|
|
assert.Equal(t, contains, true)
|
|
}
|
|
|
|
func TestParamTable_metaRootPath(t *testing.T) {
|
|
path := Params.MetaRootPath
|
|
fmt.Println(path)
|
|
}
|