2021-04-24 07:10:24 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
2021-09-22 08:01:53 +00:00
|
|
|
echo "mode: atomic" > coverage.txt
|
2021-04-24 07:10:24 +00:00
|
|
|
|
|
|
|
for d in $(go list ./internal... | grep -v vendor); do
|
2021-08-23 14:01:51 +00:00
|
|
|
go test -race -coverpkg=./... -coverprofile=profile.out -covermode=atomic "$d"
|
2021-04-24 07:10:24 +00:00
|
|
|
if [ -f profile.out ]; then
|
2021-09-22 08:01:53 +00:00
|
|
|
sed '1d' profile.out >> coverage.txt
|
2021-04-24 07:10:24 +00:00
|
|
|
rm profile.out
|
|
|
|
fi
|
|
|
|
done
|
2021-09-22 08:01:53 +00:00
|
|
|
|
|
|
|
go tool cover -html=./coverage.txt -o ./go_coverage.html
|