mirror of https://github.com/milvus-io/milvus.git
[skip ci]Add go code coverage (#5024)
Signed-off-by: Xiangyu Wang <xiangyu.wang@zilliz.com>pull/5026/head
parent
b855c283cb
commit
746fc556a0
|
@ -72,3 +72,7 @@ gtags.conf
|
|||
|
||||
# Delve generated file
|
||||
**/__debug_bin
|
||||
|
||||
# go-codecov
|
||||
coverage.txt
|
||||
profile.out
|
||||
|
|
5
Makefile
5
Makefile
|
@ -154,6 +154,11 @@ test-cpp: build-cpp-with-unittest
|
|||
@echo "Running cpp unittests..."
|
||||
@(env bash $(PWD)/scripts/run_cpp_unittest.sh)
|
||||
|
||||
# Run go-codecov
|
||||
go-codecov:
|
||||
@echo "Running go unittests..."
|
||||
@(env bash $(PWD)/scripts/run_go_codecov.sh)
|
||||
|
||||
#TODO: build each component to docker
|
||||
docker: verifiers
|
||||
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
echo "" > coverage.txt
|
||||
|
||||
for d in $(go list ./internal... | grep -v vendor); do
|
||||
go test -race -coverprofile=profile.out -covermode=atomic "$d"
|
||||
if [ -f profile.out ]; then
|
||||
cat profile.out >> coverage.txt
|
||||
rm profile.out
|
||||
fi
|
||||
done
|
Loading…
Reference in New Issue