You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rather than change XDG_DATA_HOME, since many distributions do not
explicitly define XDG_DATA_HOME but rather fallback to the default,
check if XDG_DATA_HOME is not set and if HOME is either not set or set
to the root filesystem. If so, override the setup_envtest binary
directory. This helps prevent errors on some CI/CD environments.
Signed-off-by: Tayler Geiger <[email protected]>
ENVTEST_VERSION = $(shell go list -m k8s.io/client-go | cut -d" " -f2 | sed 's/^v0\.\([[:digit:]]\{1,\}\)\.[[:digit:]]\{1,\}$$/1.\1.x/')
126
129
UNIT_TEST_DIRS=$(shell go list ./... | grep -v /test/)
127
130
test-unit: $(SETUP_ENVTEST)#HELP Run the unit tests
128
-
eval$$($(SETUP_ENVTEST) use -p env $(ENVTEST_VERSION))&& go test -tags $(GO_BUILD_TAGS) -count=1 -short $(UNIT_TEST_DIRS) -coverprofile cover.out
131
+
eval$$($(SETUP_ENVTEST) use -p env $(ENVTEST_VERSION))$(setup_envtest_bin_dir_override)&& go test -tags $(GO_BUILD_TAGS) -count=1 -short $(UNIT_TEST_DIRS) -coverprofile cover.out
0 commit comments