build, test: update go test to use go1.17

Signed-off-by: Miguel Duarte Barroso <mdbarroso@redhat.com>
This commit is contained in:
Miguel Duarte Barroso 2022-05-19 10:30:18 +02:00
parent c86cbce8a8
commit 2592e8714f

View File

@ -2,11 +2,20 @@
# single test: go test -v ./pkg/storage/
# without cache: go test -count=1 -v ./pkg/storage/
set -e -x
GO=${GO:-go}
echo "Running go vet ..."
go vet --tags=test ./cmd/... ./pkg/...
${GO} vet --tags=test ./cmd/... ./pkg/...
echo "Running golang staticcheck ..."
staticcheck --tags=test ./...
echo "Running go tests..."
KUBEBUILDER_ASSETS="$(pwd)/bin" go test --tags=test -v -covermode=count -coverprofile=coverage.out $(go list ./... | grep -v e2e | tr "\n" " ")
KUBEBUILDER_ASSETS="$(pwd)/bin" ${GO} test \
--tags=test \
-v \
-covermode=count \
-coverprofile=coverage.out \
$(${GO} list ./... | grep -v e2e | tr "\n" " ")