mirror of https://github.com/milvus-io/milvus.git
Add submodule unit test command entry (#19108)
Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com> Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>pull/19075/head
parent
fc977cb90f
commit
43d367b7d8
47
Makefile
47
Makefile
|
@ -131,30 +131,65 @@ build-cpp-with-coverage:
|
|||
# Run the tests.
|
||||
unittest: test-cpp test-go
|
||||
|
||||
test-util:
|
||||
@echo "Running go unittests..."
|
||||
@(env bash $(PWD)/scripts/run_go_unittest.sh -t util)
|
||||
|
||||
test-storage:
|
||||
@echo "Running go unittests..."
|
||||
@(env bash $(PWD)/scripts/run_go_unittest.sh -t storage)
|
||||
|
||||
test-allocator:
|
||||
@echo "Running go unittests..."
|
||||
@(env bash $(PWD)/scripts/run_go_unittest.sh -t allocator)
|
||||
|
||||
test-config:
|
||||
@echo "Running go unittests..."
|
||||
@(env bash $(PWD)/scripts/run_go_unittest.sh -t config)
|
||||
|
||||
test-tso:
|
||||
@echo "Running go unittests..."
|
||||
@(env bash $(PWD)/scripts/run_go_unittest.sh -t tso)
|
||||
|
||||
test-kv:
|
||||
@echo "Running go unittests..."
|
||||
@(env bash $(PWD)/scripts/run_go_unittest.sh -t kv)
|
||||
|
||||
test-mq:
|
||||
@echo "Running go unittests..."
|
||||
@(env bash $(PWD)/scripts/run_go_unittest.sh -t mq)
|
||||
|
||||
test-rootcoord:
|
||||
@echo "Running go unittests..."
|
||||
@(env bash $(PWD)/scripts/run_go_unittest.sh -t rootcoord)
|
||||
|
||||
test-indexnode:
|
||||
@echo "Running go unittests..."
|
||||
go test -race -coverpkg=./... -coverprofile=profile.out -covermode=atomic -timeout 5m github.com/milvus-io/milvus/internal/indexnode -v -failfast
|
||||
@(env bash $(PWD)/scripts/run_go_unittest.sh -t indexnode)
|
||||
|
||||
test-proxy:
|
||||
@echo "Running go unittests..."
|
||||
go test -race -coverpkg=./... -coverprofile=profile.out -covermode=atomic -timeout 5m github.com/milvus-io/milvus/internal/proxy -v -failfast
|
||||
@(env bash $(PWD)/scripts/run_go_unittest.sh -t proxy)
|
||||
|
||||
test-datacoord:
|
||||
@echo "Running go unittests..."
|
||||
go test -race -coverpkg=./... -coverprofile=profile.out -covermode=atomic -timeout 5m github.com/milvus-io/milvus/internal/datacoord -v -failfast
|
||||
@(env bash $(PWD)/scripts/run_go_unittest.sh -t datacoord)
|
||||
|
||||
test-datanode:
|
||||
@echo "Running go unittests..."
|
||||
go test -race -coverpkg=./... -coverprofile=profile.out -covermode=atomic -timeout 5m github.com/milvus-io/milvus/internal/datanode -v -failfast
|
||||
@(env bash $(PWD)/scripts/run_go_unittest.sh -t datanode)
|
||||
|
||||
test-querynode:
|
||||
@echo "Running go unittests..."
|
||||
go test -race -coverpkg=./... -coverprofile=profile.out -covermode=atomic -timeout 5m github.com/milvus-io/milvus/internal/querynode -v -failfast
|
||||
@(env bash $(PWD)/scripts/run_go_unittest.sh -t querynode)
|
||||
|
||||
test-querycoord:
|
||||
@echo "Running go unittests..."
|
||||
go test -race -coverpkg=./... -coverprofile=profile.out -covermode=atomic -timeout 5m github.com/milvus-io/milvus/internal/querycoord -v -failfast
|
||||
@(env bash $(PWD)/scripts/run_go_unittest.sh -t querycoord)
|
||||
|
||||
test-metastore:
|
||||
@echo "Running go unittests..."
|
||||
@(env bash $(PWD)/scripts/run_go_unittest.sh -t metastore)
|
||||
|
||||
test-go: build-cpp-with-unittest
|
||||
@echo "Running go unittests..."
|
||||
|
|
|
@ -34,12 +34,78 @@ fi
|
|||
MILVUS_DIR="${ROOT_DIR}/internal/"
|
||||
echo "Running go unittest under $MILVUS_DIR"
|
||||
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/allocator/..." -failfast
|
||||
TEST_ALL=1
|
||||
TEST_TAG="ALL"
|
||||
|
||||
while getopts "t:h" arg; do
|
||||
case $arg in
|
||||
t)
|
||||
TEST_ALL=0
|
||||
TEST_TAG=$OPTARG
|
||||
;;
|
||||
h) # help
|
||||
echo "
|
||||
parameter:
|
||||
-t: test tag(default: all)
|
||||
-h: help
|
||||
|
||||
usage:
|
||||
./go_run_unittest.sh -t \${TEST_TAG}
|
||||
"
|
||||
exit 0
|
||||
;;
|
||||
?)
|
||||
echo "ERROR! unknown argument"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
function test_proxy()
|
||||
{
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/proxy/..." -failfast
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/distributed/proxy/..." -failfast
|
||||
}
|
||||
|
||||
function test_querynode()
|
||||
{
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/querynode/..." -failfast
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/distributed/querynode/..." -failfast
|
||||
}
|
||||
|
||||
|
||||
function test_kv()
|
||||
{
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/kv/..." -failfast
|
||||
}
|
||||
|
||||
function test_mq()
|
||||
{
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} $(go list "${MILVUS_DIR}/mq/..." | grep -v kafka) -failfast
|
||||
}
|
||||
|
||||
function test_storage()
|
||||
{
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/storage" -failfast
|
||||
}
|
||||
|
||||
function test_allocator()
|
||||
{
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/allocator/..." -failfast
|
||||
}
|
||||
|
||||
function test_tso()
|
||||
{
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/tso/..." -failfast
|
||||
}
|
||||
|
||||
function test_config()
|
||||
{
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/config/..." -failfast
|
||||
}
|
||||
|
||||
function test_util()
|
||||
{
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/util/funcutil/..." -failfast
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/util/paramtable/..." -failfast
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/util/retry/..." -failfast
|
||||
|
@ -47,19 +113,123 @@ go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/util/sessionutil/..."
|
|||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/util/trace/..." -failfast
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/util/typeutil/..." -failfast
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/util/importutil/..." -failfast
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/proxy/..." -failfast
|
||||
}
|
||||
|
||||
function test_datanode
|
||||
{
|
||||
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/datanode/..." -failfast
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/indexnode/..." -failfast
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/querynode/..." -failfast
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/distributed/rootcoord/..." -failfast
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/distributed/datacoord/..." -failfast
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/distributed/querycoord/..." -failfast
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/distributed/proxy/..." -failfast
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/distributed/datanode/..." -failfast
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/distributed/querynode/..." -failfast
|
||||
|
||||
}
|
||||
|
||||
function test_indexnode()
|
||||
{
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/indexnode/..." -failfast
|
||||
}
|
||||
|
||||
function test_rootcoord()
|
||||
{
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/distributed/rootcoord/..." -failfast
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/rootcoord" -failfast
|
||||
}
|
||||
|
||||
function test_datacoord()
|
||||
{
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/distributed/datacoord/..." -failfast
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/datacoord/..." -failfast
|
||||
}
|
||||
|
||||
function test_querycoord()
|
||||
{
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/distributed/querycoord/..." -failfast
|
||||
}
|
||||
|
||||
function test_indexcoord()
|
||||
{
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/indexcoord/..." -failfast
|
||||
}
|
||||
|
||||
function test_metastore()
|
||||
{
|
||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/metastore/..." -failfast
|
||||
}
|
||||
|
||||
function test_all()
|
||||
{
|
||||
test_proxy
|
||||
test_querynode
|
||||
test_datanode
|
||||
test_indexnode
|
||||
test_rootcoord
|
||||
test_querycoord
|
||||
test_datacoord
|
||||
test_indexcoord
|
||||
test_kv
|
||||
test_mq
|
||||
test_storage
|
||||
test_allocator
|
||||
test_tso
|
||||
test_config
|
||||
test_util
|
||||
test_metastore
|
||||
}
|
||||
|
||||
|
||||
|
||||
case "${TEST_TAG}" in
|
||||
proxy)
|
||||
test_proxy
|
||||
;;
|
||||
querynode)
|
||||
test_querynode
|
||||
;;
|
||||
datanode)
|
||||
test_datanode
|
||||
;;
|
||||
indexnode)
|
||||
test_indexnode
|
||||
;;
|
||||
rootcoord)
|
||||
test_rootcoord
|
||||
;;
|
||||
querycoord)
|
||||
test_querycoord
|
||||
;;
|
||||
datacoord)
|
||||
test_datacoord
|
||||
;;
|
||||
indexcoord)
|
||||
test_indexcoord
|
||||
;;
|
||||
kv)
|
||||
test_kv
|
||||
;;
|
||||
mq)
|
||||
test_mq
|
||||
;;
|
||||
storage)
|
||||
test_storage
|
||||
;;
|
||||
allocator)
|
||||
test_allocator
|
||||
;;
|
||||
tso)
|
||||
test_tso
|
||||
;;
|
||||
config)
|
||||
test_config
|
||||
;;
|
||||
util)
|
||||
test_util
|
||||
;;
|
||||
metastore)
|
||||
test_metastore
|
||||
;;
|
||||
*) echo "Test All";
|
||||
test_all
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
echo " Go unittest finished"
|
||||
|
|
Loading…
Reference in New Issue