Rename unittest for funcutil (#7581)

Signed-off-by: yhmo <yihua.mo@zilliz.com>
pull/7587/head
groot 2021-09-08 16:53:30 +08:00 committed by GitHub
parent 618fef0a43
commit ae3a43cf37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 14 deletions

View File

@ -81,7 +81,7 @@ func buildMockComponent(code internalpb.StateCode) *MockComponent {
return mc
}
func TestCheckGrpcReady(t *testing.T) {
func Test_CheckGrpcReady(t *testing.T) {
errChan := make(chan error)
// test errChan can receive nil after interval
@ -96,7 +96,7 @@ func TestCheckGrpcReady(t *testing.T) {
cancel()
}
func TestCheckPortAvailable(t *testing.T) {
func Test_CheckPortAvailable(t *testing.T) {
num := 10
for i := 0; i < num; i++ {
@ -105,13 +105,13 @@ func TestCheckPortAvailable(t *testing.T) {
}
}
func TestGetLocalIP(t *testing.T) {
func Test_GetLocalIP(t *testing.T) {
ip := GetLocalIP()
assert.NotNil(t, ip)
assert.NotZero(t, len(ip))
}
func TestWaitForComponentInitOrHealthy(t *testing.T) {
func Test_WaitForComponentInitOrHealthy(t *testing.T) {
mc := &MockComponent{
compState: nil,
strResp: nil,
@ -145,7 +145,7 @@ func TestWaitForComponentInitOrHealthy(t *testing.T) {
}
}
func TestWaitForComponentInit(t *testing.T) {
func Test_WaitForComponentInit(t *testing.T) {
validCodes := []internalpb.StateCode{internalpb.StateCode_Initializing}
testCodes := []internalpb.StateCode{internalpb.StateCode_Initializing, internalpb.StateCode_Healthy, internalpb.StateCode_Abnormal}
for _, code := range testCodes {
@ -159,7 +159,7 @@ func TestWaitForComponentInit(t *testing.T) {
}
}
func TestWaitForComponentHealthy(t *testing.T) {
func Test_WaitForComponentHealthy(t *testing.T) {
validCodes := []internalpb.StateCode{internalpb.StateCode_Healthy}
testCodes := []internalpb.StateCode{internalpb.StateCode_Initializing, internalpb.StateCode_Healthy, internalpb.StateCode_Abnormal}
for _, code := range testCodes {
@ -173,7 +173,7 @@ func TestWaitForComponentHealthy(t *testing.T) {
}
}
func TestParseIndexParamsMap(t *testing.T) {
func Test_ParseIndexParamsMap(t *testing.T) {
num := 10
keys := make([]string, 0)
values := make([]string, 0)

View File

@ -25,12 +25,12 @@ import (
func dummyFunc() {
}
func TestGetFunctionName(t *testing.T) {
func Test_GetFunctionName(t *testing.T) {
name := GetFunctionName(dummyFunc)
assert.True(t, strings.Contains(name, "dummyFunc"))
}
func TestProcessFuncParallel(t *testing.T) {
func Test_ProcessFuncParallel(t *testing.T) {
total := 64
s := make([]int, total)

View File

@ -17,7 +17,7 @@ import (
"github.com/stretchr/testify/assert"
)
func TestRandomString(t *testing.T) {
func Test_RandomString(t *testing.T) {
length := 10
str := RandomString(length)
assert.Equal(t, len(str), length)

View File

@ -17,7 +17,7 @@ import (
"github.com/stretchr/testify/assert"
)
func TestSetContain(t *testing.T) {
func Test_SetContain(t *testing.T) {
key1 := "key1"
key2 := "key2"
key3 := "key3"

View File

@ -18,7 +18,7 @@ import (
"github.com/stretchr/testify/assert"
)
func TestSliceContain(t *testing.T) {
func Test_SliceContain(t *testing.T) {
invalid := "invalid"
assert.Panics(t, func() { SliceContain(invalid, 1) })
@ -47,7 +47,7 @@ func TestSliceContain(t *testing.T) {
}
}
func TestSliceSetEqual(t *testing.T) {
func Test_SliceSetEqual(t *testing.T) {
invalid := "invalid"
assert.Panics(t, func() { SliceSetEqual(invalid, 1) })
temp := []int{1, 2, 3}
@ -79,7 +79,7 @@ func TestSliceSetEqual(t *testing.T) {
}
}
func TestSortedSliceEqual(t *testing.T) {
func Test_SortedSliceEqual(t *testing.T) {
invalid := "invalid"
assert.Panics(t, func() { SortedSliceEqual(invalid, 1) })
temp := []int{1, 2, 3}