From b3824cb6d19f0ddaf3883bf915ac2d226089af77 Mon Sep 17 00:00:00 2001 From: yedf2 <120050102@qq.com> Date: Wed, 13 Jul 2022 12:18:47 +0800 Subject: [PATCH] fix test cover --- helper/test-cover.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/helper/test-cover.sh b/helper/test-cover.sh index 1b323e0..0ecf97e 100755 --- a/helper/test-cover.sh +++ b/helper/test-cover.sh @@ -1,13 +1,11 @@ set -x echo "mode: count" > coverage.txt for store in redis boltdb mysql postgres; do - for d in $(go list ./... | grep -v vendor); do - TEST_STORE=$store go test -failfast -covermode count -coverprofile=profile.out -coverpkg=client/dtmcli,client/dtmcli/dtmimp,client/dtmcli/logger,client/dtmgrpc,client/workflow,client/dtmgrpc/dtmgimp,dtmsvr,dtmsvr/config,dtmsvr/storage,dtmsvr/storage/boltdb,dtmsvr/storage/redis,dtmsvr/storage/registry,dtmsvr/storage/sql,dtmutil -gcflags=-l $d || exit 1 - if [ -f profile.out ]; then - cat profile.out | grep -v 'mode:' >> coverage.txt - echo > profile.out - fi - done + TEST_STORE=$store go test -failfast -covermode count -coverprofile=profile.out -coverpkg=github.com/dtm-labs/dtm/client/dtmcli,github.com/dtm-labs/dtm/client/dtmcli/dtmimp,github.com/dtm-labs/dtm/client/dtmcli/logger,github.com/dtm-labs/dtm/client/dtmgrpc,github.com/dtm-labs/dtm/client/workflow,github.com/dtm-labs/dtm/client/dtmgrpc/dtmgimp,github.com/dtm-labs/dtm/dtmsvr,dtmsvr/config,github.com/dtm-labs/dtm/dtmsvr/storage,github.com/dtm-labs/dtm/dtmsvr/storage/boltdb,github.com/dtm-labs/dtm/dtmsvr/storage/redis,github.com/dtm-labs/dtm/dtmsvr/storage/registry,github.com/dtm-labs/dtm/dtmsvr/storage/sql,github.com/dtm-labs/dtm/dtmutil -gcflags=-l ./... || exit 1 + if [ -f profile.out ]; then + cat profile.out | grep -v 'mode:' >> coverage.txt + echo > profile.out + fi done # go tool cover -html=coverage.txt