-
Notifications
You must be signed in to change notification settings - Fork 963
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update unit-test && e2e to run on Mac
Signed-off-by: Xiaodong Ye <[email protected]>
- Loading branch information
1 parent
bc356e9
commit 3a77db7
Showing
5 changed files
with
23 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ else | |
GOBIN=$(shell go env GOBIN) | ||
endif | ||
|
||
OS=$(shell uname -s) | ||
OS=$(shell uname -s | tr '[:upper:]' '[:lower:]') | ||
|
||
# Get OS architecture | ||
OSARCH=$(shell uname -m) | ||
|
@@ -85,11 +85,7 @@ vc-webhook-manager: init | |
CC=${CC} CGO_ENABLED=0 go build -ldflags ${LD_FLAGS} -o ${BIN_DIR}/vc-webhook-manager ./cmd/webhook-manager | ||
|
||
vcctl: init | ||
if [ ${OS} = 'Darwin' ];then\ | ||
CC=${CC} CGO_ENABLED=0 GOOS=darwin go build -ldflags ${LD_FLAGS} -o ${BIN_DIR}/vcctl ./cmd/cli;\ | ||
else\ | ||
CC=${CC} CGO_ENABLED=0 go build -ldflags ${LD_FLAGS} -o ${BIN_DIR}/vcctl ./cmd/cli;\ | ||
fi; | ||
CC=${CC} CGO_ENABLED=0 GOOS=${OS} go build -ldflags ${LD_FLAGS} -o ${BIN_DIR}/vcctl ./cmd/cli | ||
|
||
image_bins: vc-scheduler vc-controller-manager vc-webhook-manager | ||
|
||
|
@@ -115,8 +111,8 @@ manifests: controller-gen | |
|
||
unit-test: | ||
go clean -testcache | ||
if [ ${OS} = 'Darwin' ];then\ | ||
GOOS=darwin go list ./... | grep -v "/e2e" | xargs go test;\ | ||
if [ ${OS} = 'darwin' ];then\ | ||
go list ./... | grep -v "/e2e" | GOOS=${OS} xargs go test;\ | ||
else\ | ||
go test -p 8 -race $$(find pkg cmd -type f -name '*_test.go' | sed -r 's|/[^/]+$$||' | sort | uniq | sed "s|^|volcano.sh/volcano/|");\ | ||
fi; | ||
|
@@ -146,8 +142,8 @@ generate-yaml: init manifests | |
./hack/generate-yaml.sh TAG=${RELEASE_VER} CRD_VERSION=${CRD_VERSION} | ||
|
||
generate-charts: init manifests | ||
./hack/generate-charts.sh | ||
./hack/generate-charts.sh | ||
|
||
release-env: | ||
./hack/build-env.sh release | ||
|
||
|
@@ -190,7 +186,7 @@ ifeq (, $(shell which controller-gen)) | |
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\ | ||
cd $$CONTROLLER_GEN_TMP_DIR ;\ | ||
go mod init tmp ;\ | ||
go install sigs.k8s.io/controller-tools/cmd/[email protected] ;\ | ||
GOOS=${OS} go install sigs.k8s.io/controller-tools/cmd/[email protected] ;\ | ||
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\ | ||
} | ||
CONTROLLER_GEN=$(GOBIN)/controller-gen | ||
|
@@ -211,7 +207,7 @@ mod-download-go: | |
|
||
.PHONY: mirror-licenses | ||
mirror-licenses: mod-download-go; \ | ||
go install istio.io/tools/cmd/[email protected]; \ | ||
GOOS=${OS} go install istio.io/tools/cmd/[email protected]; \ | ||
cd licenses; \ | ||
rm -rf `ls ./ | grep -v LICENSE`; \ | ||
cd -; \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,7 @@ function check-kind { | |
which kind >/dev/null 2>&1 | ||
if [[ $? -ne 0 ]]; then | ||
echo "Installing kind ..." | ||
go install sigs.k8s.io/[email protected] | ||
GOOS=${OS} go install sigs.k8s.io/[email protected] | ||
else | ||
echo -n "Found kind, version: " && kind version | ||
fi | ||
|
@@ -94,7 +94,7 @@ function install-ginkgo-if-not-exist { | |
which ginkgo >/dev/null 2>&1 | ||
if [[ $? -ne 0 ]]; then | ||
echo "Installing ginkgo ..." | ||
go install github.com/onsi/ginkgo/v2/ginkgo | ||
GOOS=${OS} go install github.com/onsi/ginkgo/v2/ginkgo | ||
else | ||
echo -n "Found ginkgo, version: " && ginkgo version | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters