File tree Expand file tree Collapse file tree 2 files changed +29
-7
lines changed Expand file tree Collapse file tree 2 files changed +29
-7
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ COMPUTE_NODES ?= 2
99
1010OCI_BIN ?= docker
1111
12+ SKIP_STATIC_CHECK ?= false
13+
1214build :
1315 hack/build-go.sh
1416
@@ -23,7 +25,10 @@ install-tools:
2325 hack/install-kubebuilder-tools.sh
2426
2527test : build install-tools
26- hack/test-go.sh
28+ hack/test-go.sh --skip-static-check false
29+
30+ test-skip-static : build
31+ hack/test-go.sh --skip-static-check true
2732
2833kind :
2934 hack/e2e-setup-kind-cluster.sh -n $(COMPUTE_NODES )
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22# single test: go test -v ./pkg/storage/
33# without cache: go test -count=1 -v ./pkg/storage/
4- set -e -x
4+ set -eox pipefail
55
66GO=${GO:- go}
77
8+
9+ while true ; do
10+ case " $1 " in
11+ -s|--skip-static-check)
12+ SKIP_STATIC_CHECK=false
13+ break
14+ ;;
15+ * )
16+ echo " define argument -s (skip static check)"
17+ exit 1
18+ esac
19+ done
20+
821echo " Running go vet ..."
922${GO} vet --tags=test ./cmd/... ./pkg/...
1023
1124BASEDIR=$( pwd)
1225
13- echo " Installing golang staticcheck ..."
14- GOBIN=${BASEDIR} /bin go install honnef.co/go/tools/cmd/staticcheck@latest
15-
16- echo " Running golang staticcheck ..."
17- ${BASEDIR} /bin/staticcheck --tags=test ./...
26+ if [ $SKIP_STATIC_CHECK ]
27+ then
28+ echo " Skipped golang staticcheck"
29+ else
30+ echo " Installing golang staticcheck ..."
31+ GOBIN=${BASEDIR} /bin go install honnef.co/go/tools/cmd/staticcheck@latest
32+ echo " Running golang staticcheck ..."
33+ ${BASEDIR} /bin/staticcheck --tags=test ./...
34+ fi
1835
1936echo " Running go tests..."
2037KUBEBUILDER_ASSETS=" $( pwd) /bin" ${GO} test \
You can’t perform that action at this time.
0 commit comments