File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -129,15 +129,25 @@ endif
129
129
$(ARTIFACTS ) :
130
130
mkdir -p $@
131
131
132
- ifeq ($(shell go env GOOS) ,darwin) # Use the darwin/amd64 binary until an arm64 version is available
133
- KUBEBUILDER_ASSETS ?= $(shell $(SETUP_ENVTEST ) use --use-env -p path --arch amd64 $(KUBEBUILDER_ENVTEST_KUBERNETES_VERSION ) )
134
- else
135
- KUBEBUILDER_ASSETS ?= $(shell $(SETUP_ENVTEST ) use --use-env -p path $(KUBEBUILDER_ENVTEST_KUBERNETES_VERSION ) )
132
+ setup_envtest_extra_args =
133
+ # Use the darwin/amd64 binary until an arm64 version is available
134
+ ifeq ($(shell go env GOOS) ,darwin)
135
+ setup_envtest_extra_args += --arch amd64
136
+ endif
137
+
138
+ # By default setup-envtest will write to $XDG_DATA_HOME, or $HOME/.local/share
139
+ # if that is not defined. Set KUBEBUILDER_ASSETS_DIR to override.
140
+ ifdef KUBEBUILDER_ASSETS_DIR
141
+ setup_envtest_extra_args += --bin-dir $(KUBEBUILDER_ASSETS_DIR)
136
142
endif
137
143
138
144
.PHONY : test
139
145
test : $(SETUP_ENVTEST ) # # Run tests
140
- KUBEBUILDER_ASSETS=" $( KUBEBUILDER_ASSETS) " go test -v ./... $(TEST_ARGS )
146
+ set -xeuf -o pipefail; \
147
+ if [ -z " $( KUBEBUILDER_ASSETS) " ]; then \
148
+ KUBEBUILDER_ASSETS=` $( SETUP_ENVTEST) use --use-env -p path $( setup_envtest_extra_args) $( KUBEBUILDER_ENVTEST_KUBERNETES_VERSION) ` ; \
149
+ fi ; \
150
+ KUBEBUILDER_ASSETS=" $$ KUBEBUILDER_ASSETS" go test -v ./... $(TEST_ARGS )
141
151
142
152
E2E_TEMPLATES_DIR =test/e2e/data/infrastructure-openstack
143
153
E2E_KUSTOMIZE_DIR =test/e2e/data/kustomize
You can’t perform that action at this time.
0 commit comments