From 2d3ad78cf911c4fe865316f62ad7b83d720dbfe8 Mon Sep 17 00:00:00 2001 From: mattjmcnaughton Date: Tue, 5 Feb 2019 18:57:02 -0500 Subject: [PATCH] Support make test WHAT=path/to/pkg/... In 99cdc069e2604decae6883dd46015c2118d55a8a, we added a check for whether the directory the user was attempting to test existed or not. However, adding this check prevented us from running `make test WHAT=./path/to/pkg/...`, because we believed that `./path/to/pkg/...` wasn't a valid path to a directory. Fix this by stripping `/...` before checking whether the directory exists. --- hack/make-rules/test.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hack/make-rules/test.sh b/hack/make-rules/test.sh index 4d380c34092..af1fa3ec910 100755 --- a/hack/make-rules/test.sh +++ b/hack/make-rules/test.sh @@ -223,6 +223,10 @@ verifyAndSuggestPackagePath() { local original_package_path="$3" local suggestion_package_path="$4" + if [[ "${specified_package_path}" =~ '/...'$ ]]; then + specified_package_path=${specified_package_path::-4} + fi + if ! [ -d "${specified_package_path}" ]; then # Because k8s sets a localized $GOPATH for testing, seeing the actual # directory can be confusing. Instead, just show $GOPATH if it exists in the