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,7 @@ COMPUTE_NODES ?= 2
99
1010OCI_BIN ?= docker
1111
12+
1213build :
1314 hack/build-go.sh
1415
@@ -23,7 +24,10 @@ install-tools:
2324 hack/install-kubebuilder-tools.sh
2425
2526test : build install-tools
26- hack/test-go.sh
27+ hack/test-go.sh
28+
29+ test-skip-static : build
30+ hack/test-go.sh --skip-static-check
2731
2832kind :
2933 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}
7+ SKIP_STATIC_CHECK=$false
8+ # parse args
9+ while [[ $# -gt 0 ]]; do
10+ case " $1 " in
11+ -s|--skip-static-check)
12+ SKIP_STATIC_CHECK=true
13+ shift
14+ ;;
15+ * )
16+ echo " Invalid arguement: $1 "
17+ echo " Usage: $0 [-s|--skip-static-check]"
18+ exit 1
19+ esac
20+ done
721
822echo " Running go vet ..."
923${GO} vet --tags=test ./cmd/... ./pkg/...
1024
1125BASEDIR=$( pwd)
1226
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 ./...
27+ if [ $SKIP_STATIC_CHECK ]
28+ then
29+ echo " Skipped golang staticcheck"
30+ else
31+ echo " Installing golang staticcheck ..."
32+ GOBIN=${BASEDIR} /bin go install honnef.co/go/tools/cmd/staticcheck@latest
33+ echo " Running golang staticcheck ..."
34+ ${BASEDIR} /bin/staticcheck --tags=test ./...
35+ fi
1836
1937echo " Running go tests..."
2038KUBEBUILDER_ASSETS=" $( pwd) /bin" ${GO} test \
You can’t perform that action at this time.
0 commit comments