Merge pull request #92212 from thockin/verify-typecheck-no-gopath

Make verify-typecheck not depend on GOPATH
This commit is contained in:
Kubernetes Prow Robot
2020-06-26 20:16:14 -07:00
committed by GitHub
10 changed files with 407 additions and 438 deletions

View File

@@ -366,3 +366,5 @@ cat <<__EOF__ > "vendor/OWNERS"
approvers:
- dep-approvers
__EOF__
kube::log::status "NOTE: don't forget to handle vendor/* files that were added or removed"

View File

@@ -68,7 +68,7 @@ while IFS='' read -r line; do
all_packages+=("./$line")
done < <( hack/make-rules/helpers/cache_go_dirs.sh "${KUBE_ROOT}/_tmp/all_go_dirs" |
grep "^${FOCUS:-.}" |
grep -vE "(third_party|generated|clientset_generated|hack|/_)" |
grep -vE "(third_party|generated|clientset_generated|hack|testdata|/_)" |
grep -vE "$ignore_pattern" )
failing_packages=()

View File

@@ -30,8 +30,12 @@ cd "${KUBE_ROOT}"
make --no-print-directory -C "${KUBE_ROOT}" generated_files
# As of June, 2020 the typecheck tool is written in terms of go/packages, but
# that library doesn't work well with multiple modules. Until that is done,
# force this tooling to run in a fake GOPATH.
ret=0
go run test/typecheck/main.go "$@" || ret=$?
hack/run-in-gopath.sh \
go run test/typecheck/main.go "$@" || ret=$?
if [[ $ret -ne 0 ]]; then
echo "!!! Type Check has failed. This may cause cross platform build failures." >&2
echo "!!! Please see https://git.k8s.io/kubernetes/test/typecheck for more information." >&2