-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge master and address PR comments
- Loading branch information
1 parent
43a54e7
commit 8c655e6
Showing
83 changed files
with
3,149 additions
and
840 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,83 @@ | ||
#!/bin/bash | ||
|
||
check_missing_value() { | ||
if [[ $1 -eq 0 || $2 == -* ]]; then | ||
echo "missing $3 argument value" | ||
exit 1 | ||
fi | ||
} | ||
|
||
timeout="" | ||
tags="" | ||
run="" | ||
race=false | ||
cover=false | ||
while [[ $# -gt 0 ]]; do | ||
case $1 in | ||
--timeout) | ||
shift | ||
check_missing_value $# "$1" "--timeout" | ||
timeout=$1 | ||
shift | ||
;; | ||
--tags) | ||
shift | ||
check_missing_value $# "$1" "--tags" | ||
tags=$1 | ||
shift | ||
;; | ||
--run) | ||
shift | ||
check_missing_value $# "$1" "--run" | ||
run=$1 | ||
shift | ||
;; | ||
--race) | ||
race=true | ||
shift | ||
;; | ||
--cover) | ||
cover=true | ||
shift | ||
;; | ||
*) | ||
echo "Invalid argument: $1" | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
packages=$(go list ./...) | ||
for package in $packages; do | ||
cmd="stdbuf -oL gotestsum --format short-verbose --packages=\"$package\" --rerun-fails=2 --no-color=false --" | ||
|
||
if [ "$timeout" != "" ]; then | ||
cmd="$cmd -timeout $timeout" | ||
fi | ||
|
||
if [ "$tags" != "" ]; then | ||
cmd="$cmd -tags=$tags" | ||
fi | ||
|
||
if [ "$run" != "" ]; then | ||
cmd="$cmd -run=$run" | ||
fi | ||
|
||
if [ "$race" == true ]; then | ||
cmd="$cmd -race" | ||
fi | ||
|
||
if [ "$cover" == true ]; then | ||
cmd="$cmd -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...,./go-ethereum/..." | ||
fi | ||
|
||
cmd="$cmd > >(stdbuf -oL tee -a full.log | grep -vE \"INFO|seal\")" | ||
|
||
echo "" | ||
echo running tests for "$package" | ||
echo "$cmd" | ||
|
||
if ! eval "$cmd"; then | ||
exit 1 | ||
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
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
Oops, something went wrong.