-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·26 lines (24 loc) · 1.02 KB
/
test.sh
File metadata and controls
executable file
·26 lines (24 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env zsh
for d in `find . -iname '*_test.go' | xargs -n 1 dirname | sort | uniq | paste -sd ' ' -`; do
# if [[ $1 == "" || $1 == `basename $d` ]]; then
pushd $d
# highlight source files in this dir
match="/$(basename $(pwd))/\\S*\.go\|^\\S*_test.go"
export WARP_ENV="local"
export WARP_SERVICE="test"
export WARP_DOMAIN="bringyour.com"
export WARP_BLOCK="test"
export WARP_VERSION="0.0.0"
export BRINGYOUR_POSTGRES_HOSTNAME="local-pg.bringyour.com"
export BRINGYOUR_REDIS_HOSTNAME="local-redis.bringyour.com"
# go test -v "$@" | grep --color=always -e "^" -e "$match"
GORACE="log_path=profile/race.out halt_on_error=1" go test -timeout 0 -v -race -cpuprofile profile/cpu -memprofile profile/memory "$@" | grep --color=always -e "^" -e "$match"
if [[ ${pipestatus[1]} != 0 ]]; then
exit ${pipestatus[1]}
fi
popd
# fi
done
# stdbuf -i0 -o0 -e0
# ./test.sh -run 'pattern'
# ./test.sh -short