Skip to content

Commit

Permalink
ci: fix coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed Nov 15, 2020
1 parent 01a7695 commit fd441fc
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ _fuzz/*/crashers
_fuzz/*/suppressions

.idea

# coverage and other outputs
*.out
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ fuzz-schema-coordinator:
go-fuzz -coordinator localhost:1105 -workdir _fuzz/schema/

test:
go test ./...
@./go.test.sh
coverage:
@./go.coverage.sh
12 changes: 12 additions & 0 deletions go.coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

set -e
touch coverage.out

for d in $(go list ./... | grep -v vendor); do
go test -coverprofile=profile.out -covermode=atomic "$d"
if [[ -f profile.out ]]; then
cat profile.out >> coverage.out
rm profile.out
fi
done
9 changes: 9 additions & 0 deletions go.test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -e

# test fuzz inputs
go test -tags gofuzz -run TestFuzz -v .

# test with -race
go test -race ./...

0 comments on commit fd441fc

Please sign in to comment.