diff --git a/Makefile b/Makefile index b0b3a7cd..39acddc6 100644 --- a/Makefile +++ b/Makefile @@ -120,12 +120,12 @@ test: manifests generate fmt vet envtest ## Run tests. e2etest: make --no-print-directory _e2etest # Workaround to force the flag on Github Action -_e2etest-infra: kind ctlptl tilt kuttl kustomize clusterctl +local-deploy: kind ctlptl tilt kuttl kustomize clusterctl @echo -n "LINODE_TOKEN=$(LINODE_TOKEN)" > config/default/.env.linode $(CTLPTL) apply -f .tilt/ctlptl-config.yaml $(TILT) ci --timeout 240s -f Tiltfile -_e2etest: manifests generate _e2etest-infra +_e2etest: manifests generate local-deploy ROOT_DIR="$(PWD)" $(KUTTL) test --config e2e/kuttl-config.yaml ## -------------------------------------- diff --git a/docs/src/developers/development.md b/docs/src/developers/development.md index 5ef40a54..7cbea261 100644 --- a/docs/src/developers/development.md +++ b/docs/src/developers/development.md @@ -98,7 +98,7 @@ go get @ ### Using tilt To build a kind cluster and start Tilt, simply run: ```sh -make tilt-cluster +make local-deploy ``` Once your kind management cluster is up and running, you can diff --git a/e2e/Makefile b/e2e/Makefile index 5ca1917a..994aeff3 100644 --- a/e2e/Makefile +++ b/e2e/Makefile @@ -10,21 +10,9 @@ runThisTest: _runThisTest: @D="$$(mktemp -d)" ;\ cp $(ROOT_DIR)/e2e/Makefile $$D ;\ - mkdir $$D/suit ;\ - cp -r $(PWD) $$D/suit ;\ - ROOT_DIR=$(ROOT_DIR) KUBECONFIG="$(ROOT_DIR)/kubeconfig" kubectl-kuttl test --timeout 300 --skip-delete "$$D/suit" - -getKubeUid: - @kubectl get -o jsonpath='{.metadata.uid}' -n "$$NAMESPACE" "$$OBJ" - -getKubeLabel: - @kubectl get -o jsonpath='{.spec.label}' -n "$$NAMESPACE" "$$OBJ" - -patchKubeObj: - @kubectl patch --type=merge -p "$$PATCH" -n "$$NAMESPACE" "$$OBJ" - -patchKubeObjStatus: - @kubectl patch --type=merge --subresource status -p "$$PATCH" -n "$$NAMESPACE" "$$OBJ" + mkdir $$D/suite ;\ + cp -r $(PWD) $$D/suite ;\ + ROOT_DIR=$(ROOT_DIR) KUBECONFIG="$(ROOT_DIR)/kubeconfig" kubectl-kuttl test --timeout 300 --skip-delete "$$D/suite" callLinodeApiGet: @curl -s -H "Authorization: Bearer $$LINODE_TOKEN" -H "X-Filter: $$FILTER" -H "Content-Type: application/json" "https://$(TARGET_API)/$(TARGET_API_VERSION)/$$URI" diff --git a/e2e/README.MD b/e2e/README.MD index 055a2c48..9ab71aa1 100644 --- a/e2e/README.MD +++ b/e2e/README.MD @@ -2,9 +2,8 @@ The E2E framework uses Kuttl under the hood. Kuttl is a simple and most importantly static tool that handles applying manifests for running assertions in a namespace it generates for each test. -In order to dynamically generate manifests, Kuttl supports declaring a `TestStep` manifest which includes an option for running scripts. This allows us apply manifests with dynamic values from stdin. -Additionally, helper functions can be invoked in the scripts by creating a Makefile in each test folder that references `../../Makefile` (i.e. `e2e/Makefile`). +Helper functions can be invoked in the scripts by creating a Makefile in each test folder that references `../../Makefile` (i.e. `e2e/Makefile`) in order to do custom validation. ## Example TestStep @@ -13,20 +12,7 @@ apiVersion: kuttl.dev/v1beta1 kind: TestStep commands: - script: |- - cat <