Use bash to run 'test' Makefile target #2121
Labels
kind/bug
Categorizes issue or PR as related to a bug.
triage/duplicate
Indicates an issue is a duplicate of other open issue.
Let's assume I have
/bin/sh
as default shell. But error occurs also if I don't have $SHELL explicitly set (because GNU Make defaults to sh).When running
make test
I have the following error messages:And since sourcing script which would have set
KUBEBUILDER_ASSETS
failed, I have the following error as test result:What versions of software are you using? Specifically, the following are often useful:
go1.15.10 darwin/amd64
3.0.0-beta.1
v0.7.2
I've solved my issue with setting the
SHELL
environment variable to/bin/bash/
for thetest
target with the following code:ENVTEST_ASSETS_DIR=$(shell pwd)/bin +test: SHELL := /bin/bash test: manifests generate fmt vet mkdir -p ${ENVTEST_ASSETS_DIR} test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.7.2/hack/setup-envtest.sh source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); go test ./... -coverprofile cover.out
/kind bug
The text was updated successfully, but these errors were encountered: