(WIP) Travis: Show new/changed uncovered lines

pull/108/head
JeremyRand 5 years ago
parent 9d386f500b
commit 73053d9092
No known key found for this signature in database
GPG Key ID: B3F2D165786D6570

@ -0,0 +1,16 @@
#!/usr/bin/env python3
import sys
for line in sys.stdin:
try:
filename, no_filename = line.split(':')
start_and_end = no_filename.split(' ')[0]
start, end = start_and_end.split(',')
start_line = int(start.split('.')[0])
end_line = int(end.split('.')[0])
except ValueError:
print(line)
continue
for line_num in range(start_line, end_line+1):
print(filename + ':' + str(line_num) + ': Uncovered')

@ -2,7 +2,7 @@
# Upstream q is broken, and this also causes dns-prop279 to be broken.
#travis_retry go get github.com/tcnksm/ghr github.com/mitchellh/gox gopkg.in/alecthomas/gometalinter.v2 github.com/miekg/exdns/q github.com/namecoin/dns-prop279
travis_retry go get github.com/tcnksm/ghr github.com/mitchellh/gox gopkg.in/alecthomas/gometalinter.v2
travis_retry go get github.com/tcnksm/ghr github.com/mitchellh/gox gopkg.in/alecthomas/gometalinter.v2 github.com/bradleyfalzon/revgrep/...
go test -v -coverprofile coverage.out ./...
RESULT=$?
@ -12,10 +12,14 @@ if [ "$RESULT" != "0" ]; then
return $RESULT
fi
# TODO: Maybe fail the build if new uncovered lines are added.
echo "Uncovered lines:"
echo ""
grep -v -e " 1$" coverage.out
grep -v -e " 1$" coverage.out | sed "s_github.com/namecoin/ncdns/__"
echo ""
echo "New/changed uncovered lines:"
echo ""
grep -v -e " 1$" coverage.out | sed "s_github.com/namecoin/ncdns/__" | ./.travis/coverage_interpolate | revgrep "${TRAVIS_BRANCH}"
echo ""
# Static analysis

Loading…
Cancel
Save