mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-29 18:38:44 +08:00
Update code coverage script (#8280)
Signed-off-by: yhmo <yihua.mo@zilliz.com>
This commit is contained in:
parent
f834ceafdd
commit
77e88144fc
12
.gitignore
vendored
12
.gitignore
vendored
@ -76,15 +76,15 @@ gtags.conf
|
||||
# Delve generated file
|
||||
**/__debug_bin
|
||||
|
||||
# go-codecov
|
||||
# codecov-go generated files
|
||||
coverage.txt
|
||||
profile.out
|
||||
cover.out
|
||||
coverage.html
|
||||
profile.txt
|
||||
go_coverage.html
|
||||
|
||||
#cpp-codecov
|
||||
*.info
|
||||
lcov_out/
|
||||
# codecov-cpp generated files
|
||||
lcov_*.info
|
||||
cpp_coverage/
|
||||
|
||||
# virtualenv
|
||||
venv/
|
||||
|
10
Makefile
10
Makefile
@ -121,15 +121,15 @@ test-cpp: build-cpp-with-unittest
|
||||
@(env bash $(PWD)/scripts/run_cpp_unittest.sh)
|
||||
|
||||
# Runs code coverage.
|
||||
codecov: go-codecov cpp-codecov
|
||||
codecov: codecov-go codecov-cpp
|
||||
|
||||
# Run go-codecov
|
||||
go-codecov: build-cpp-with-unittest
|
||||
# Run codecov-go
|
||||
codecov-go: build-cpp-with-unittest
|
||||
@echo "Running go coverage..."
|
||||
@(env bash $(PWD)/scripts/run_go_codecov.sh)
|
||||
|
||||
# Run cpp-codecov
|
||||
cpp-codecov: build-cpp-with-unittest
|
||||
# Run codecov-cpp
|
||||
codecov-cpp: build-cpp-with-unittest
|
||||
@echo "Running cpp coverage..."
|
||||
@(env bash $(PWD)/scripts/run_cpp_codecov.sh)
|
||||
|
||||
|
@ -24,7 +24,7 @@ FILE_INFO_BASE="${ROOT_DIR}/lcov_base.info"
|
||||
FILE_INFO_UT="${ROOT_DIR}/lcov_ut.info"
|
||||
FILE_INFO_COMBINE="${ROOT_DIR}/lcov_combine.info"
|
||||
FILE_INFO_OUTPUT="${ROOT_DIR}/lcov_output.info"
|
||||
DIR_LCOV_OUTPUT="${ROOT_DIR}/lcov_html"
|
||||
DIR_LCOV_OUTPUT="${ROOT_DIR}/cpp_coverage"
|
||||
DIR_GCNO="${ROOT_DIR}/cmake_build/"
|
||||
|
||||
# delete old code coverage info files
|
||||
|
@ -1,12 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
echo "" > coverage.txt
|
||||
echo "mode: atomic" > coverage.txt
|
||||
|
||||
for d in $(go list ./internal... | grep -v vendor); do
|
||||
go test -race -coverpkg=./... -coverprofile=profile.out -covermode=atomic "$d"
|
||||
if [ -f profile.out ]; then
|
||||
cat profile.out >> coverage.txt
|
||||
sed '1d' profile.out >> coverage.txt
|
||||
rm profile.out
|
||||
fi
|
||||
done
|
||||
|
||||
go tool cover -html=./coverage.txt -o ./go_coverage.html
|
||||
|
Loading…
Reference in New Issue
Block a user