Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for make verify WHAT=typecheck #60618

Merged
merged 2 commits into from
Mar 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions build/root/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@ define VERIFY_HELP_INFO
#
# Args:
# BRANCH: Branch to be passed to verify-godeps.sh script.
# WHAT: List of checks to run
#
# Example:
# make verify
# make verify BRANCH=branch_x
# make verify WHAT="bazel typecheck"
endef
.PHONY: verify
ifeq ($(PRINT_HELP),y)
Expand Down
1 change: 0 additions & 1 deletion hack/jenkins/verify-dockerized.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,4 @@ export LOG_LEVEL=4

cd /go/src/k8s.io/kubernetes

./hack/install-etcd.sh
make verify
3 changes: 3 additions & 0 deletions hack/lib/etcd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ kube::etcd::cleanup() {
kube::etcd::install() {
(
cd "${KUBE_ROOT}/third_party"
if [[ $(readlink etcd) == etcd-v${ETCD_VERSION}-* ]]; then
return # already installed
fi
if [[ $(uname) == "Darwin" ]]; then
download_file="etcd-v${ETCD_VERSION}-darwin-amd64.zip"
url="https://github.com/coreos/etcd/releases/download/v${ETCD_VERSION}/${download_file}"
Expand Down
31 changes: 24 additions & 7 deletions hack/make-rules/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ function is-quick {
return 1
}

function is-explicitly-chosen {
local name="${1#verify-}"
name="${name%.*}"
for e in ${WHAT}; do
if [[ $e == "$name" ]]; then
return
fi
done
return 1
}

function run-cmd {
local filename="${2##*/verify-}"
local testname="${filename%%.*}"
Expand Down Expand Up @@ -109,13 +120,19 @@ function run-checks {
for t in $(ls ${pattern})
do
local check_name="$(basename "${t}")"
if is-excluded "${t}" ; then
echo "Skipping ${check_name}"
continue
fi
if ${QUICK} && ! is-quick "${t}" ; then
echo "Skipping ${check_name} in quick mode"
continue
if [[ ! -z ${WHAT:-} ]]; then
if ! is-explicitly-chosen "${check_name}"; then
continue
fi
else
if is-excluded "${t}" ; then
echo "Skipping ${check_name}"
continue
fi
if ${QUICK} && ! is-quick "${t}" ; then
echo "Skipping ${check_name} in quick mode"
continue
fi
fi
echo -e "Verifying ${check_name}"
local start=$(date +%s)
Expand Down
1 change: 1 addition & 0 deletions hack/verify-openapi-spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"

kube::golang::setup_env
kube::etcd::install

make -C "${KUBE_ROOT}" WHAT=cmd/kube-apiserver

Expand Down
1 change: 1 addition & 0 deletions hack/verify-swagger-spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"

kube::golang::setup_env
kube::etcd::install

make -C "${KUBE_ROOT}" WHAT=cmd/kube-apiserver

Expand Down