Skip to content

Commit

Permalink
e2e enhancements (#34)
Browse files Browse the repository at this point in the history
* test: updated minio service name

* test: removed redundant entires and added task monitor script

* test: fixed the for loop issue
  • Loading branch information
avtarOPS authored Apr 17, 2023
1 parent df61a3e commit c716a61
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 45 deletions.
48 changes: 4 additions & 44 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,6 @@ vet: ## Run go vet against code.
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out

.PHONY: e2e
e2e: ## Runs e2e tests
e2e/e2e.sh

.PHONY: kind
kind: ## Bootstrap Kind Locally
sh e2e/kind.sh

## Make Docker build for kind registery
.PHONY: docker-build-local
docker-build-local: ## Build docker image with the manager.
docker build -t ${IMG_KIND}:${IMG_TAG} .

## Make Docker push locally to kind registery
.PHONY: docker-push-local
docker-push-local: ## Build docker image with the manager.
docker push ${IMG_KIND}:${IMG_TAG}

##@ Build

Expand Down Expand Up @@ -164,29 +147,6 @@ helm-lint: ## Lint Helm chart.
helm-template: ## Run Helm template.
helm -n druid-operator-system template --create-namespace ${NAMESPACE_DRUID_OPERATOR} ./chart --debug

.PHONY: helm-install-druid-operator
helm-install-druid-operator: ## helm upgrade/install.
helm upgrade --install \
--namespace ${NAMESPACE_DRUID_OPERATOR} \
--create-namespace \
${NAMESPACE_DRUID_OPERATOR} chart/ \
--set image.repository=${IMG_KIND} \
--set image.tag=${IMG_TAG}

.PHONY: helm-minio-install
helm-minio-install: ## Helm deploy minio operator and minio
helm repo add minio https://operator.min.io/
helm repo update minio
helm upgrade --install \
--namespace ${NAMESPACE_MINIO_OPERATOR} \
--create-namespace \
${NAMESPACE_MINIO_OPERATOR} minio/operator \
-f e2e/configs/minio-operator-override.yaml
helm upgrade --install \
--namespace ${NAMESPACE_DRUID} \
--create-namespace \
${NAMESPACE_DRUID}-minio minio/tenant \
-f e2e/configs/minio-tenant-override.yaml

##@ Build Dependencies

Expand Down Expand Up @@ -227,7 +187,7 @@ $(ENVTEST): $(LOCALBIN)

## e2e deployment
.PHONY: e2e
e2e:
e2e: ## Runs e2e tests
e2e/e2e.sh

## Build Kind
Expand All @@ -247,12 +207,12 @@ docker-push-local: ## Build docker image with the manager.

## Make Docker build for test image
.PHONY: docker-build-local-test
docker-build-local: ## Build docker image with the manager.
docker-build-local-test: ## Build docker image with the manager.
docker build -t ${IMG_KIND}:${TEST_IMG_TAG} -f e2e/Dockerfile-testpod .

## Make Docker push locally to kind registery
.PHONY: docker-push-local-test
docker-push-local: ## Build docker image with the manager.
docker-push-local-test: ## Build docker image with the manager.
docker push ${IMG_KIND}:${TEST_IMG_TAG}

## Helm install to deploy the druid operator
Expand Down Expand Up @@ -285,4 +245,4 @@ helm-minio-install:
.PHONY: deploy-testjob
deploy-testjob:
kubectl create job wiki-test --image=${IMG_KIND}:${TEST_IMG_TAG} -- sh /wikipedia-test.sh

bash e2e/monitor-task.sh
2 changes: 1 addition & 1 deletion e2e/configs/druid-cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ spec:
druid.s3.enabePathStyleAccess=true
druid.s3.endpoint.signingRegion=us-east-1
druid.s3.enablePathStyleAccess=true
druid.s3.endpoint.url=http://minio1-hl.druid.svc.cluster.local:9000/
druid.s3.endpoint.url=http://myminio-hl.druid.svc.cluster.local:9000/
#
# Extensions
#
Expand Down
26 changes: 26 additions & 0 deletions e2e/monitor-task.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
#!/bin/sh
set -e
echo "---------------"
echo "Checking the status of running job ..."
for (( i=0; i<=9; i++ ))
do
sleep 60
STAT=`kubectl get job wiki-test --template={{.status.succeeded}}`
if [ "$STAT" == "<no value>" ]
then
echo "Seems to be in progress ..."
elif [ $STAT == 1 ]
then
echo "Job completed Successfully !!!"
break
fi
if [ $i == 9 ]
then
echo "================"
echo "Task Timeout ..."
echo "FAILED EXITING !!!"
echo "================"
exit 1
fi
done

0 comments on commit c716a61

Please sign in to comment.