fix: commands to run unit tests (#988)

* fix: commands to run unit tests

Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
pull/990/head
Oleksandr Andriienko 2021-08-03 09:09:21 +03:00 committed by GitHub
parent cd0de9b068
commit 784f536c17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

3
.vscode/tasks.json vendored
View File

@ -66,6 +66,9 @@
"problemMatcher": [
"$go"
],
"options": {
"env": {"MOCK_API": "true"}
},
"presentation": {
"reveal": "always"
},

View File

@ -272,7 +272,7 @@ ENVTEST_ASSETS_DIR=$(shell pwd)/testbin
test: manifests generate fmt vet ## Run tests.
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.6.3/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 -mod=vendor ./... -coverprofile cover.out
source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); export MOCK_API=true; go test -mod=vendor ./... -coverprofile cover.out
##@ Build