-cover causes races in Go 1.2

Make -covermode=atomic the default until we drop 1.2 support
Enable Go 1.2 in Travis
This commit is contained in:
Clayton Coleman
2014-07-11 14:41:15 -04:00
parent e6ee45d38e
commit 9a9d140a8a
3 changed files with 34 additions and 2 deletions

View File

@@ -35,14 +35,16 @@ find_test_dirs() {
)
}
# -covermode=atomic becomes default with -race in Go >=1.3
KUBE_COVER="-cover -covermode=atomic -coverprofile=\"tmp.out\""
cd "${KUBE_TARGET}"
if [ "$1" != "" ]; then
go test -race -cover -coverprofile="tmp.out" "$KUBE_GO_PACKAGE/$1" "${@:2}"
go test -race $KUBE_COVER "$KUBE_GO_PACKAGE/$1" "${@:2}"
exit 0
fi
for package in $(find_test_dirs); do
go test -race -cover -coverprofile="tmp.out" "${KUBE_GO_PACKAGE}/${package}" "${@:2}"
go test -race $KUBE_COVER "${KUBE_GO_PACKAGE}/${package}" "${@:2}"
done