diff --git a/hack/lib/testselect.bash b/hack/lib/testselect.bash index b6d4d1983a..ff409be658 100644 --- a/hack/lib/testselect.bash +++ b/hack/lib/testselect.bash @@ -2,15 +2,7 @@ function run_testselect { if [[ -n "${ARTIFACT_DIR:-}" && -n "${CLONEREFS_OPTIONS:-}" ]]; then - local clonedir rootdir hack_tmp_dir - - hack_tmp_dir=$(mktemp -d) - git clone --branch main https://github.com/openshift-knative/hack "$hack_tmp_dir" - pushd "$hack_tmp_dir" || return $? - go install github.com/openshift-knative/hack/cmd/testselect - popd || return $? - rm -rf "$hack_tmp_dir" - + local clonedir rootdir clonedir=$(mktemp -d) # CLONEREFS_OPTIONS var is set in CI @@ -22,7 +14,7 @@ function run_testselect { # The testselect clones a repository. Make sure it's cloned into a temp dir. pushd "$clonedir" || return $? - "$(go env GOPATH)/bin/testselect" --testsuites="${rootdir}/test/testsuites.yaml" --clonerefs="${ARTIFACT_DIR}/clonerefs.json" --output="${ARTIFACT_DIR}/tests.txt" + go run github.com/openshift-knative/hack/cmd/testselect@latest --testsuites="${rootdir}/test/testsuites.yaml" --clonerefs="${ARTIFACT_DIR}/clonerefs.json" --output="${ARTIFACT_DIR}/tests.txt" popd || return $? logger.info 'Tests to be run:'