mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 17:48:29 +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
|
# Delve generated file
|
||||||
**/__debug_bin
|
**/__debug_bin
|
||||||
|
|
||||||
# go-codecov
|
# codecov-go generated files
|
||||||
coverage.txt
|
coverage.txt
|
||||||
profile.out
|
profile.out
|
||||||
cover.out
|
profile.txt
|
||||||
coverage.html
|
go_coverage.html
|
||||||
|
|
||||||
#cpp-codecov
|
# codecov-cpp generated files
|
||||||
*.info
|
lcov_*.info
|
||||||
lcov_out/
|
cpp_coverage/
|
||||||
|
|
||||||
# virtualenv
|
# virtualenv
|
||||||
venv/
|
venv/
|
||||||
|
|||||||
10
Makefile
10
Makefile
@ -121,15 +121,15 @@ test-cpp: build-cpp-with-unittest
|
|||||||
@(env bash $(PWD)/scripts/run_cpp_unittest.sh)
|
@(env bash $(PWD)/scripts/run_cpp_unittest.sh)
|
||||||
|
|
||||||
# Runs code coverage.
|
# Runs code coverage.
|
||||||
codecov: go-codecov cpp-codecov
|
codecov: codecov-go codecov-cpp
|
||||||
|
|
||||||
# Run go-codecov
|
# Run codecov-go
|
||||||
go-codecov: build-cpp-with-unittest
|
codecov-go: build-cpp-with-unittest
|
||||||
@echo "Running go coverage..."
|
@echo "Running go coverage..."
|
||||||
@(env bash $(PWD)/scripts/run_go_codecov.sh)
|
@(env bash $(PWD)/scripts/run_go_codecov.sh)
|
||||||
|
|
||||||
# Run cpp-codecov
|
# Run codecov-cpp
|
||||||
cpp-codecov: build-cpp-with-unittest
|
codecov-cpp: build-cpp-with-unittest
|
||||||
@echo "Running cpp coverage..."
|
@echo "Running cpp coverage..."
|
||||||
@(env bash $(PWD)/scripts/run_cpp_codecov.sh)
|
@(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_UT="${ROOT_DIR}/lcov_ut.info"
|
||||||
FILE_INFO_COMBINE="${ROOT_DIR}/lcov_combine.info"
|
FILE_INFO_COMBINE="${ROOT_DIR}/lcov_combine.info"
|
||||||
FILE_INFO_OUTPUT="${ROOT_DIR}/lcov_output.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/"
|
DIR_GCNO="${ROOT_DIR}/cmake_build/"
|
||||||
|
|
||||||
# delete old code coverage info files
|
# delete old code coverage info files
|
||||||
|
|||||||
@ -1,12 +1,14 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
echo "" > coverage.txt
|
echo "mode: atomic" > coverage.txt
|
||||||
|
|
||||||
for d in $(go list ./internal... | grep -v vendor); do
|
for d in $(go list ./internal... | grep -v vendor); do
|
||||||
go test -race -coverpkg=./... -coverprofile=profile.out -covermode=atomic "$d"
|
go test -race -coverpkg=./... -coverprofile=profile.out -covermode=atomic "$d"
|
||||||
if [ -f profile.out ]; then
|
if [ -f profile.out ]; then
|
||||||
cat profile.out >> coverage.txt
|
sed '1d' profile.out >> coverage.txt
|
||||||
rm profile.out
|
rm profile.out
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
go tool cover -html=./coverage.txt -o ./go_coverage.html
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user