Move away from recursive go test, as it cannot output a merged coverage profile. Update said profile to coveralls.io; add badge.
This commit is contained in:
1 parent
254b837a92
commit
d28d52da15
4 files changed
+18
-3
No files matched your search
@@ -61,7 +61,15 @@ $(DOCKER_DISTRIB):
|
||||
curl -o $(DOCKER_DISTRIB) $(DOCKER_DISTRIB_URL)
|
||||
|
||||
tests:
|
||||
go test -cover -tags netgo ./...
|
||||
echo "mode: count" > profile.cov
|
||||
for dir in $$(find . -type f -name '*_test.go' | xargs -n1 dirname | sort -u); do \
|
||||
go test -tags netgo -covermode=count -coverprofile=$$dir/profile.tmp $$dir; \
|
||||
if [ -f $$dir/profile.tmp ]; then \
|
||||
cat $$dir/profile.tmp | tail -n +2 >> profile.cov; \
|
||||
rm $$dir/profile.tmp; \
|
||||
fi \
|
||||
done
|
||||
go tool cover -html=profile.cov -o=coverage.html
|
||||
|
||||
$(PUBLISH): publish_%:
|
||||
$(SUDO) docker tag -f $(DOCKERHUB_USER)/$* $(DOCKERHUB_USER)/$*:$(WEAVE_VERSION)
|
||||
|
||||
Reference in new issue
Block a user