2 Star 0 Fork 0

mirrors_apache/cloudberry-gpbackup

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
show_coverage.sh 1014 Bytes
一键复制 编辑 原始数据 按行查看 历史
Dianjin Wang 提交于 2023-11-20 10:52 . Update package name to CloudberryDB
#!/bin/bash
DIR="github.com/cloudberrydb/gpbackup"
RESULTS="/tmp/results.out"
go test -coverpkg $DIR/backup $DIR/integration -coverprofile=/tmp/coverage.out 2> /dev/null | awk '{print $2 " test " $4 "\t" $5}' | awk -F"/" '{print $4}' > $RESULTS
for PACKAGE in "backup" "restore" "utils"; do
# Generate code coverage statistics for all packages, write the coverage statistics to a file, and print the coverage percentage to the shell
go test -coverpkg "$DIR/$PACKAGE" "$DIR/$PACKAGE" -coverprofile="/tmp/unit_$PACKAGE.out" | awk '{print $2 " unit test " $4 "\t" $5}' | awk -F"/" '{print $4}' >> $RESULTS
# Filter out the first "mode: set" line from each coverage file and concatenate them all
cat "/tmp/unit_$PACKAGE.out" | awk '{if($1!="mode:") {print $1 " " $2 " " $3}}' >> /tmp/coverage.out
done
# Print the total coverage percentage and generate a coverage HTML page
go tool cover -func=/tmp/coverage.out | awk '{if($1=="total:") {print $1 "\t\t\t\t" $3}}' >> $RESULTS
cat $RESULTS
rm $RESULTS
exit 0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_apache/cloudberry-gpbackup.git
git@gitee.com:mirrors_apache/cloudberry-gpbackup.git
mirrors_apache
cloudberry-gpbackup
cloudberry-gpbackup
REL_1_STABLE

搜索帮助