-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
don't use -race with coverage, don't cover with -race
given the way we present output, we are redundantly running tests with -race, which will make tests run unnecessarily longer, especially for older versions of Go.
- Loading branch information
1 parent
b3edf74
commit e6c23d8
Showing
3 changed files
with
14 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
echo > coverage.txt | ||
|
||
for d in $(go list ./... | grep -v -E '/vendor|/examples|/docker'); do | ||
go test -coverprofile=profile.out -covermode=atomic "$d" | ||
if [ -f profile.out ]; then | ||
cat profile.out >> coverage.txt | ||
rm profile.out | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
echo > coverage.txt | ||
|
||
for d in $(go list ./... | grep -v -E '/vendor|/examples|/docker'); do | ||
go test -race -coverprofile=profile.out -covermode=atomic $d | ||
if [ -f profile.out ]; then | ||
cat profile.out >> coverage.txt | ||
rm profile.out | ||
fi | ||
go test -race "$d" | ||
done |