From a672b501dfa764d343c3fa6cf6520f0f73777ec5 Mon Sep 17 00:00:00 2001 From: deads2k Date: Wed, 4 Jan 2017 11:20:01 -0500 Subject: [PATCH] add apiserver to list of unit tested packages --- hack/make-rules/test-integration.sh | 2 +- hack/make-rules/test-kubeadm-cmd.sh | 2 +- hack/make-rules/test.sh | 16 ++++++++++------ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/hack/make-rules/test-integration.sh b/hack/make-rules/test-integration.sh index 00ab70692ff..e04792acb24 100755 --- a/hack/make-rules/test-integration.sh +++ b/hack/make-rules/test-integration.sh @@ -42,7 +42,7 @@ kube::test::find_integration_test_dirs() { ( cd ${KUBE_ROOT} find test/integration/${1-} -name '*_test.go' -print0 \ - | xargs -0n1 dirname \ + | xargs -0n1 dirname | sed "s|^|${KUBE_GO_PACKAGE}/|" \ | LC_ALL=C sort -u ) } diff --git a/hack/make-rules/test-kubeadm-cmd.sh b/hack/make-rules/test-kubeadm-cmd.sh index c28d7d00e51..c6cbbfe52e0 100755 --- a/hack/make-rules/test-kubeadm-cmd.sh +++ b/hack/make-rules/test-kubeadm-cmd.sh @@ -28,5 +28,5 @@ KUBEADM_PATH="${KUBEADM_PATH:=$(kube::realpath "${KUBE_ROOT}")/cluster/kubeadm.s make -C "${KUBE_ROOT}" WHAT=cmd/kubeadm make -C "${KUBE_ROOT}" test \ - WHAT=cmd/kubeadm/test \ + WHAT=k8s.io/kubernetes/cmd/kubeadm/test \ KUBE_TEST_ARGS="--kubeadm-path '${KUBEADM_PATH}'" diff --git a/hack/make-rules/test.sh b/hack/make-rules/test.sh index 69c4a615c3e..5700afad31e 100755 --- a/hack/make-rules/test.sh +++ b/hack/make-rules/test.sh @@ -48,14 +48,18 @@ kube::test::find_dirs() { -o -path './staging/*' \ -o -path './vendor/*' \ \) -prune \ - \) -name '*_test.go' -print0 | xargs -0n1 dirname | sed 's|^\./||' | LC_ALL=C sort -u + \) -name '*_test.go' -print0 | xargs -0n1 dirname | sed "s|^\./|${KUBE_GO_PACKAGE}/|" | LC_ALL=C sort -u find -L . \ -path './_output' -prune \ -o -path './vendor/k8s.io/client-go/*' \ -o -path './vendor/k8s.io/apiserver/*' \ -o -path './test/e2e_node/system/*' \ - -name '*_test.go' -print0 | xargs -0n1 dirname | sed 's|^\./||' | LC_ALL=C sort -u + -name '*_test.go' -print0 | xargs -0n1 dirname | sed "s|^\./|${KUBE_GO_PACKAGE}/|" | LC_ALL=C sort -u + + # run tests for apiserver + find ./staging/src/k8s.io/apiserver -name '*_test.go' \ + -name '*_test.go' -print0 | xargs -0n1 dirname | sed 's|^\./staging/src/|./vendor/|' | LC_ALL=C sort -u ) } @@ -206,10 +210,10 @@ runTests() { # the build artifacts but doesn't run the tests. The two together provide # a large speedup for tests that do not need to be rebuilt. go test -i "${goflags[@]:+${goflags[@]}}" \ - ${KUBE_RACE} ${KUBE_TIMEOUT} "${@+${@/#/${KUBE_GO_PACKAGE}/}}" \ + ${KUBE_RACE} ${KUBE_TIMEOUT} "${@}" \ "${testargs[@]:+${testargs[@]}}" go test "${goflags[@]:+${goflags[@]}}" \ - ${KUBE_RACE} ${KUBE_TIMEOUT} "${@+${@/#/${KUBE_GO_PACKAGE}/}}" \ + ${KUBE_RACE} ${KUBE_TIMEOUT} "${@}" \ "${testargs[@]:+${testargs[@]}}" \ | tee ${junit_filename_prefix:+"${junit_filename_prefix}.stdout"} \ | grep "${go_test_grep_pattern}" && rc=$? || rc=$? @@ -255,14 +259,14 @@ runTests() { ${KUBE_TIMEOUT} \ -cover -covermode=\"${KUBE_COVERMODE}\" \ -coverprofile=\"${cover_report_dir}/\${_pkg}/${cover_profile}\" \ - \"${KUBE_GO_PACKAGE}/\${_pkg}\" \ + \"${_pkg}\" \ ${testargs[@]:+${testargs[@]}} go test ${goflags[@]:+${goflags[@]}} \ ${KUBE_RACE} \ ${KUBE_TIMEOUT} \ -cover -covermode=\"${KUBE_COVERMODE}\" \ -coverprofile=\"${cover_report_dir}/\${_pkg}/${cover_profile}\" \ - \"${KUBE_GO_PACKAGE}/\${_pkg}\" \ + \"${_pkg}\" \ ${testargs[@]:+${testargs[@]}} \ | tee ${junit_filename_prefix:+\"${junit_filename_prefix}-\$_pkg_out.stdout\"} \ | grep \"${go_test_grep_pattern}\"" \