mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-29 18:38:44 +08:00
[skip ci]Add go code coverage (#5024)
Signed-off-by: Xiangyu Wang <xiangyu.wang@zilliz.com>
This commit is contained in:
parent
b855c283cb
commit
746fc556a0
4
.gitignore
vendored
4
.gitignore
vendored
@ -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
|
||||
|
||||
|
12
scripts/run_go_codecov.sh
Executable file
12
scripts/run_go_codecov.sh
Executable file
@ -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
Block a user