fix(tests): try to get code coverage from all packages

This commit is contained in:
Łukasz Mierzwa
2020-02-06 12:23:19 +00:00
parent 904dad83d6
commit 8c64eea1f8
2 changed files with 17 additions and 3 deletions

View File

@@ -167,9 +167,7 @@ benchmark-go:
.PHONY: test-go
test-go:
GO111MODULE=on go test \
-cover -coverprofile=coverage.txt -covermode=atomic \
./...
GO111MODULE=on scripts/gocover.sh
.PHONY: test-js
test-js: .build/deps-build-node.ok

16
scripts/gocover.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -e
echo "" > coverage.txt
for d in $(go list ./... | grep -v github.com/prymitive/karma/internal/mapper); do
go test \
-coverprofile=profile.out \
-coverpkg=$(go list ./... | grep -v github.com/prymitive/karma/internal/mapper | tr '\n' ',') \
$d 2>&1 | grep -v 'warning: no packages being tested depend on matches for pattern'
if [ -f profile.out ]; then
cat profile.out >> coverage.txt
rm profile.out
fi
done