@@ -68,11 +68,8 @@ $(info Using kubevirtci kubectl)
6868KUBECTL_PATH = $(PWD ) /cluster-up/kubectl.sh
6969endif
7070
71- # CONTAINER_TOOL defines the container tool to be used for building images.
72- # Be aware that the target commands are only tested with Docker which is
73- # scaffolded by default. However, you might want to replace it to use other
74- # tools. (i.e. podman)
75- CONTAINER_TOOL ?= docker
71+ MIGRATION_CONTROLLER_NAMESPACE ?= kubevirt
72+ CONTAINER_TOOL ?= podman
7673
7774# Setting SHELL to bash allows bash commands to be executed by recipes.
7875# Options are set to exit when a recipe line exits non-zero or a piped command fails.
@@ -135,16 +132,18 @@ vet: ## Run go vet against code.
135132 go vet ./...
136133
137134.PHONY : test
138- test : manifests generate fmt vet setup-envtest # # Run tests.
139- KUBEBUILDER_ASSETS=" $( shell $( ENVTEST) use $( ENVTEST_K8S_VERSION) --bin-dir $( LOCALBIN) -p path) " go test $$(go list ./... | grep -v /e2e ) -coverprofile cover.out
135+ test : manifests generate fmt vet setup-envtest gotestsum # # Run tests.
136+ @echo " Running unit tests gotestsum $( GOTESTSUM) "
137+ KUBEBUILDER_ASSETS=" $( shell $( ENVTEST) use $( ENVTEST_K8S_VERSION) --bin-dir $( LOCALBIN) -p path) " $(GOTESTSUM ) --junitfile $(ARTIFACTS ) /junit.functest.xml -- $$(go list ./... | grep -v /e2e ) -coverprofile cover.out
140138
141139# TODO(user): To use a different vendor for e2e tests, modify the setup under 'tests/e2e'.
142140# The default setup assumes Kind is pre-installed and builds/loads the Manager Docker image locally.
143141# CertManager is installed by default; skip with:
144142# - CERT_MANAGER_INSTALL_SKIP=true
145143.PHONY : test-e2e
146- test-e2e : manifests generate fmt vet # # Run the e2e tests. Expected an isolated environment using Kind.
147- go test ./test/e2e/ -v -ginkgo.v --kubectl-path=$(KUBECTL_PATH ) --test-kubeconfig=$(KUBECONFIG ) --kubeurl=$(KUBEURL )
144+ test-e2e : manifests generate fmt vet gotestsum # # Run the e2e tests. Expected an isolated environment using Kind.
145+ @echo " Running e2e tests gotestsum $( GOTESTSUM) "
146+ $(GOTESTSUM ) --junitfile $(ARTIFACTS ) /junit.functest.xml -- ./test/e2e/ -v -ginkgo.v --migration-controller-namespace=$(MIGRATION_CONTROLLER_NAMESPACE ) --kubectl-path=$(KUBECTL_PATH ) --test-kubeconfig=$(KUBECONFIG ) --kubeurl=$(KUBEURL )
148147
149148.PHONY : lint
150149lint : golangci-lint # # Run golangci-lint linter
@@ -243,6 +242,8 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
243242CLIENT_GEN ?= $(LOCALBIN ) /client-gen
244243ENVTEST ?= $(LOCALBIN ) /setup-envtest
245244GOLANGCI_LINT = $(LOCALBIN ) /golangci-lint
245+ ARTIFACTS ?= $(PWD ) /_artifacts
246+ GOTESTSUM ?= $(LOCALBIN ) /gotestsum
246247
247248# # Tool Versions
248249KUSTOMIZE_VERSION ?= v5.6.0
@@ -254,6 +255,7 @@ ENVTEST_VERSION ?= $(shell go list -m -f "{{ .Version }}" sigs.k8s.io/controller
254255# ENVTEST_K8S_VERSION is the version of Kubernetes to use for setting up ENVTEST binaries (i.e. 1.31)
255256ENVTEST_K8S_VERSION ?= $(shell go list -m -f "{{ .Version }}" k8s.io/api | awk -F'[v.]' '{printf "1.% d", $$3}')
256257GOLANGCI_LINT_VERSION ?= v1.63.4
258+ GOTESTSUM_VERSION ?= v1.13.0
257259
258260.PHONY : kustomize
259261kustomize : $(KUSTOMIZE ) # # Download kustomize locally if necessary.
@@ -270,6 +272,11 @@ client-gen: $(CLIENT_GEN) ## Download client-gen locally if necessary.
270272$(CLIENT_GEN ) : $(LOCALBIN )
271273 $(call go-install-tool,$(CLIENT_GEN ) ,k8s.io/code-generator/cmd/client-gen,$(CLIENT_GEN_VERSION ) )
272274
275+ .PHONY : gotestsum
276+ gotestsum : $(GOTESTSUM ) # # Download gotestsum locally if necessary.
277+ $(GOTESTSUM ) : $(LOCALBIN )
278+ $(call go-install-tool,$(GOTESTSUM ) ,gotest.tools/gotestsum,$(GOTESTSUM_VERSION ) )
279+
273280.PHONY : setup-envtest
274281setup-envtest : envtest # # Download the binaries required for ENVTEST in the local bin directory.
275282 @echo " Setting up envtest binaries for Kubernetes version $( ENVTEST_K8S_VERSION) ..."
0 commit comments