@@ -223,6 +223,10 @@ configvar CSI_PROW_SANITY_SERVICE "hostpath-service" "Kubernetes TCP service nam
223
223
configvar CSI_PROW_SANITY_POD " csi-hostpathplugin-0" " Kubernetes pod with CSI driver"
224
224
configvar CSI_PROW_SANITY_CONTAINER " hostpath" " Kubernetes container with CSI driver"
225
225
226
+ # The version of dep to use for 'make test-vendor'. Ignored if the project doesn't
227
+ # use dep. Only binary releases of dep are supported (https://github.com/golang/dep/releases).
228
+ configvar CSI_PROW_DEP_VERSION v0.5.1 " golang dep version to be used for vendor checking"
229
+
226
230
# Each job can run one or more of the following tests, identified by
227
231
# a single word:
228
232
# - unit testing
@@ -396,6 +400,15 @@ install_ginkgo () {
396
400
mv " $GOPATH /bin/ginkgo" " ${CSI_PROW_BIN} "
397
401
}
398
402
403
+ # Ensure that we have the desired version of dep.
404
+ install_dep () {
405
+ if dep version 2> /dev/null | grep -q " version:.*${CSI_PROW_DEP_VERSION} $" ; then
406
+ return
407
+ fi
408
+ run curl --fail --location -o " ${CSI_PROW_WORK} /bin/dep" " https://github.com/golang/dep/releases/download/v0.5.4/dep-linux-amd64" &&
409
+ chmod u+x " ${CSI_PROW_WORK} /bin/dep"
410
+ }
411
+
399
412
# This checks out a repo ("https://github.com/kubernetes/kubernetes")
400
413
# in a certain location ("$GOPATH/src/k8s.io/kubernetes") at
401
414
# a certain revision (a hex commit hash, v1.13.1, master). It's okay
@@ -936,6 +949,10 @@ main () {
936
949
# changes in "release-tools" in a PR (that fails the "is release-tools unmodified"
937
950
# test).
938
951
if tests_enabled " unit" ; then
952
+ if [ -f Gopkg.toml ] && ! install_dep; then
953
+ warn " installing 'dep' failed, cannot test vendoring"
954
+ ret=1
955
+ fi
939
956
if ! run_with_go " ${CSI_PROW_GO_VERSION_BUILD} " make -k test 2>&1 | make_test_to_junit; then
940
957
warn " 'make test' failed, proceeding anyway"
941
958
ret=1
0 commit comments