forked from kubernetes/ingress-nginx
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
84 additions
and
71 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
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,13 @@ | ||
#!/bin/bash | ||
|
||
# Licensed Materials - Property of IBM | ||
# Copyright IBM Corporation 2018. All Rights Reserved. | ||
# U.S. Government Users Restricted Rights - | ||
# Use, duplication or disclosure restricted by GSA ADP | ||
# IBM Corporation - initial API and implementation | ||
|
||
COVERAGE=$(go tool cover -func=cover.out | grep "total:" | awk '{ print $3 }' | sed 's/[][()><%]/ /g') | ||
|
||
echo "-------------------------------------------------------------------------" | ||
echo "TOTAL COVERAGE IS ${COVERAGE}%" | ||
echo "-------------------------------------------------------------------------" |
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,30 @@ | ||
#!/bin/bash | ||
|
||
# Licensed Materials - Property of IBM | ||
# Copyright IBM Corporation 2018. All Rights Reserved. | ||
# U.S. Government Users Restricted Rights - | ||
# Use, duplication or disclosure restricted by GSA ADP | ||
# IBM Corporation - initial API and implementation | ||
|
||
# NOTE: This script should not be called directly. Please run `make test`. | ||
|
||
set -e | ||
|
||
_package=$1 | ||
echo "Testing package $_package" | ||
|
||
# Make sure temporary files do not exist | ||
rm -f cover.tmp | ||
|
||
# Run tests | ||
# -coverpkg=./... produces warnings to stderr that we filter out | ||
go test -v -cover -coverpkg=./... -covermode=atomic -coverprofile=cover.tmp $_package | ||
|
||
# Merge coverage files | ||
if [ -a cover.tmp ]; then | ||
$GOPATH/bin/gocovmerge cover.tmp cover.out > cover.all | ||
mv cover.all cover.out | ||
fi | ||
|
||
# Clean up temporary files | ||
rm -f cover.tmp |
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,14 @@ | ||
#!/bin/bash | ||
|
||
# Licensed Materials - Property of IBM | ||
# Copyright IBM Corporation 2018. All Rights Reserved. | ||
# U.S. Government Users Restricted Rights - | ||
# Use, duplication or disclosure restricted by GSA ADP | ||
# IBM Corporation - initial API and implementation | ||
|
||
set -e | ||
|
||
_script_dir=$(dirname "$0") | ||
echo 'mode: atomic' > cover.out | ||
echo '' > cover.tmp | ||
go list ./... | grep -v vendor | xargs -n1 -I{} $_script_dir/test-package.sh {} |
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