diff --git a/.github/workflows/kind-integration.yml b/.github/workflows/kind-integration.yml index d5adac01f..2b9b097bb 100644 --- a/.github/workflows/kind-integration.yml +++ b/.github/workflows/kind-integration.yml @@ -83,7 +83,7 @@ jobs: NAMESPACE: ${{ env.DSPA_NAMESPACE }} DSPA_NAME: ${{ env.DSPA_NAME }} run: | - go run github.com/onsi/ginkgo/v2/ginkgo --tags=test_integration -- -kubeconfig=$HOME/.kube/config -k8sApiServerHost=$(oc whoami --show-server) -DSPANamespace=${{ env.DSPA_NAMESPACE }} -DSPAPath=resources/dspa-lite.yaml -ginkgo.v + make integrationtest K8SAPISERVERHOST=$(oc whoami --show-server) DSPANAMESPACE=dspa - name: Clean up run: | diff --git a/Makefile b/Makefile index c1ea49cb4..6089ec6e9 100644 --- a/Makefile +++ b/Makefile @@ -53,6 +53,12 @@ ENVTEST_K8S_VERSION = 1.25.0 # Namespace to deploy the operator OPERATOR_NS ?= odh-applications +# Integration Test ENVvars +KUBECONFIGPATH ?= $(HOME)/.kube/config +K8SAPISERVERHOST ?= http://localhost:6443 +DSPANAMESPACE ?= default +DSPAPATH ?= resources/dspa-lite.yaml + # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) GOBIN=$(shell go env GOPATH)/bin @@ -115,6 +121,11 @@ unittest: manifests generate fmt vet envtest ## Run tests. functest: manifests generate fmt vet envtest ## Run tests. KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... --tags=test_functional -coverprofile cover.out +.PHONY: integrationtest +integrationtest: ## Run integration tests + cd tests && \ + go run github.com/onsi/ginkgo/v2/ginkgo --tags=test_integration -- -kubeconfig=${KUBECONFIGPATH} -k8sApiServerHost=${K8SAPISERVERHOST} -DSPANamespace=${DSPANAMESPACE} -DSPAPath=${DSPAPATH} -ginkgo.v + ##@ Build .PHONY: build