Add code coverage for go files

Signed-off-by: cai.zhang <cai.zhang@zilliz.com>
pull/4973/head^2
cai.zhang 2020-11-10 15:56:57 +08:00 committed by yefu.chen
parent 5e67e5eb43
commit a2f2284932
2 changed files with 9 additions and 2 deletions

View File

@ -31,6 +31,7 @@ type MsgStream interface {
Produce(*MsgPack) error
Broadcast(*MsgPack) error
Consume() *MsgPack
Chan() <-chan *MsgPack
}
type PulsarMsgStream struct {
@ -108,7 +109,9 @@ func (ms *PulsarMsgStream) Start() {
func (ms *PulsarMsgStream) Close() {
ms.streamCancel()
ms.wait.Wait()
if ms.wait != nil {
ms.wait.Wait()
}
for _, producer := range ms.producers {
if producer != nil {
@ -252,6 +255,10 @@ func (ms *PulsarMsgStream) bufMsgPackToChannel() {
}
}
func (ms *PulsarMsgStream) Chan() <-chan *MsgPack {
return ms.receiveBuf
}
type PulsarTtMsgStream struct {
PulsarMsgStream
inputBuf []*TsMsg

View File

@ -13,4 +13,4 @@ SCRIPTS_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
# ignore Minio,S3 unittes
MILVUS_DIR="${SCRIPTS_DIR}/../internal/"
echo $MILVUS_DIR
go test "${MILVUS_DIR}/kv/..." "${MILVUS_DIR}/msgstream/..." "${MILVUS_DIR}/master/..." "${MILVUS_DIR}/reader/..." -failfast
go test -cover "${MILVUS_DIR}/kv/..." "${MILVUS_DIR}/msgstream/..." "${MILVUS_DIR}/master/..." "${MILVUS_DIR}/reader/..." -failfast