Skip to content

Commit

Permalink
Add make command for integration tests.
Browse files Browse the repository at this point in the history
Signed-off-by: Humair Khan <HumairAK@users.noreply.github.com>
  • Loading branch information
HumairAK committed Oct 24, 2023
1 parent cdd4e81 commit 08c63d7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/kind-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jobs:
with:
fetch-depth: 0

- name: Set up Go 1.18.10
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.18.10
go-version: '1.19.x'
id: go

- name: Setup and start KinD cluster
Expand Down Expand Up @@ -78,12 +78,12 @@ jobs:
kubectl create namespace ${{ env.DSPA_NAMESPACE }}
- name: Run tests
working-directory: ${{ env.INTEGRATION_TESTS_DIR }}
working-directory: ${{ github.workspace }}
env:
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=${NAMESPACE}
- name: Clean up
run: |
Expand Down
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 4 additions & 6 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,10 @@ git clone git@github.com:opendatahub-io/data-science-pipelines-operator.git ${DS
# Make sure DSPO is already deployed, if not then run:
make deploy

cd tests
go run github.com/onsi/ginkgo/v2/ginkgo --tags=test_integration -- \
-kubeconfig=${KUBECONFIG_PATH} \
-k8sApiServerHost=${TARGET_CLUSTER} \
-DSPANamespace=${TARGET_NAMESPACE} -DSPAPath=resources/dspa-lite.yaml \
-ginkgo.v
make integrationtest \
K8SAPISERVERHOST=${TARGET_CLUSTER} \
DSPANAMESPACE=${NAMESPACE} \
KUBECONFIGPATH=${KUBECONFIG_PATH}
```

#### Use existing DSPA install
Expand Down

0 comments on commit 08c63d7

Please sign in to comment.