github.com/m3db/m3@v1.5.1-0.20231129193456-75a402aa583b/scripts/process-cover.sh (about) 1 #!/bin/bash 2 3 if [ $# -ne 1 ] || [ -z "$1" ]; then 4 echo "usage: $0 <coverfile.out>" 5 exit 1 6 fi 7 8 COVERFILE=$1 9 SUBMIT_COVER="$(dirname $0)/../.ci/codecov.sh" 10 11 TARGETS=("aggregator" "dbnode" "query" "cluster" "m3ninx" "m3em" "x") 12 target_patterns() { 13 case $1 in 14 'cluster') echo "^mode|github.com/m3db/m3/src/cluster";; 15 'aggregator') echo "^mode|github.com/m3db/m3/src/aggregator|github.com/m3db/m3/src/cmd/services/m3aggregator";; 16 'dbnode') echo "^mode|github.com/m3db/m3/src/dbnode|github.com/m3db/m3/src/cmd/services/m3dbnode";; 17 'query') echo "^mode|github.com/m3db/m3/src/query|github.com/m3db/m3/src/cmd/services/m3query";; 18 'm3em') echo "^mode|github.com/m3db/m3/src/m3em|github.com/m3db/m3/src/cmd/services/m3em_agent";; 19 'm3ninx') echo "^mode|github.com/m3db/m3/src/m3ninx";; 20 'x') echo "^mode|github.com/m3db/m3/src/x";; 21 'msg') echo "^mode|github.com/m3db/m3/src/msg";; 22 *) echo "unknown key: $1"; exit 1;; 23 esac 24 } 25 26 if [ ! -f $COVERFILE ]; then 27 echo "$COVERFILE does not exist" 28 exit 1 29 fi 30 31 for t in ${TARGETS[@]}; do 32 cat $COVERFILE | grep -E $(target_patterns $t) > ${t}.out 33 ${SUBMIT_COVER} -f ${t}.out -F ${t} 34 done