mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-06 11:42:14 +00:00
-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:
@@ -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
|
||||
|
Reference in New Issue
Block a user