Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
Migrate tests to kuttl (#110)
Browse files Browse the repository at this point in the history
* Migrate all the tests to KUTTL

Signed-off-by: Alex Lembiewski <[email protected]>

* Update 'operators' submodule

Signed-off-by: Alex Lembiewski <[email protected]>

* Update Spark image tag, added make target for updating Spark image in manifests

Signed-off-by: Alex Lembiewski <[email protected]>

* Exclude SparkApplicationCompleted events from assertions

Signed-off-by: Alex Lembiewski <[email protected]>

* Update make target to include manifests in templates, update image tags

Signed-off-by: Alex Lembiewski <[email protected]>

* Remove go tests, moved kuttl test-cases

Signed-off-by: Alex Lembiewski <[email protected]>

* Fix app arguments placeholders, update make target

Signed-off-by: Alex Lembiewski <[email protected]>

* Improve log collectors, set 'deleteOnTermination' to 'false' for executors

Signed-off-by: Alex Lembiewski <[email protected]>

* Increase read timeout for kubernetes-client

Signed-off-by: Alex Lembiewski <[email protected]>

* Fix KUBERNETES_REQUEST_TIMEOUT value format

Signed-off-by: Alex Lembiewski <[email protected]>

* Revert "Fix KUBERNETES_REQUEST_TIMEOUT value format"

This reverts commit 11e5534

Signed-off-by: Alex Lembiewski <[email protected]>

* Revert "Increase read timeout for kubernetes-client"

This reverts commit 9123f81

Signed-off-by: Alex Lembiewski <[email protected]>

* Revert KUBERNETES_REQUEST_TIMEOUT from spark-pi.yaml

Signed-off-by: Alex Lembiewski <[email protected]>

* Set 'spark.kubernetes.submission.*Timeout' properties for test SparkApplication's

Signed-off-by: Alex Lembiewski <[email protected]>
  • Loading branch information
alembiewski authored Oct 13, 2020
1 parent b63ff6f commit d7e9ffb
Show file tree
Hide file tree
Showing 190 changed files with 2,350 additions and 4,557 deletions.
28 changes: 21 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,25 +115,39 @@ docker-push:
fi

# Testing

# this target updates Spark image for all SparkApplication manifests in tests
.PHONY: update-spark-image-in-test-manifests
update-spark-image-in-test-manifests:
if ! command -v yq &> /dev/null; then
echo 'Error: yq is not installed.' >&2
exit 1
fi
for yaml in tests/**/**/*.yaml; do
if [[ `yq r $$yaml 'kind'` == 'SparkApplication' ]]; then
yq w -i $$yaml 'spec.image' $(SPARK_IMAGE_FULL_NAME)
fi
done

.PHONY: test
test: docker-builder
test: docker-push
test:
docker run -i --rm \
-v $(ROOT_DIR):/kudo-spark-operator \
-v $(KUBECONFIG):/root/.kube/config \
-e TEST_DIR=/kudo-spark-operator/tests \
-w /kudo-spark-operator \
-e ROOT_DIR=/kudo-spark-operator \
-e KUBECONFIG=/root/.kube/config \
-e SPARK_IMAGE=$(SPARK_IMAGE_FULL_NAME) \
-e OPERATOR_IMAGE=$(OPERATOR_IMAGE_FULL_NAME) \
-e TEAMCITY_VERSION="$(TEAMCITY_VERSION)" \
-e OPERATOR_DOCKER_REPO=$(OPERATOR_DOCKER_REPO) \
-e OPERATOR_VERSION=$(OPERATOR_VERSION) \
-e AWS_ACCESS_KEY_ID="$(AWS_ACCESS_KEY_ID)" \
-e AWS_SECRET_ACCESS_KEY="$(AWS_SECRET_ACCESS_KEY)" \
-e AWS_SESSION_TOKEN="$(AWS_SESSION_TOKEN)" \
-e AWS_BUCKET_NAME="$(AWS_BUCKET_NAME)" \
-e AWS_BUCKET_PATH="$(AWS_BUCKET_PATH)" \
-e AWS_BUCKET_NAME=$(AWS_BUCKET_NAME) \
-e AWS_BUCKET_PATH=$(AWS_BUCKET_PATH) \
$(shell cat $(ROOT_DIR)/docker-builder) \
/kudo-spark-operator/tests/run.sh
kubectl kuttl test --report xml $(KUTTL_FLAGS)

.PHONY: install
install:
Expand Down
21 changes: 13 additions & 8 deletions images/builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
FROM golang:1.13.0@sha256:de697ce5ae02f3d9a57b0603fbb648efadfa212727e702ad3a807b43eba7f6d6
FROM python:3.8.2-slim-buster

ARG KUDO_DOWNLOAD_URL=https://github.com/kudobuilder/kudo/releases/download/v0.15.0/kubectl-kudo_0.15.0_linux_x86_64
ARG KUBECTL_DOWNLOAD_URL=https://storage.googleapis.com/kubernetes-release/release/v1.17.8/bin/linux/amd64/kubectl
ARG KUDO_VERSION=0.15.0
ARG KUBECTL_VERSION=1.17.8
ARG KUTTL_VERSION=0.6.1
ARG KUDO_DOWNLOAD_URL=https://github.com/kudobuilder/kudo/releases/download/v${KUDO_VERSION}/kubectl-kudo_${KUDO_VERSION}_linux_x86_64
ARG KUBECTL_DOWNLOAD_URL=https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl
ARG KUTTL_DOWNLOAD_URL=https://github.com/kudobuilder/kuttl/releases/download/v${KUTTL_VERSION}/kubectl-kuttl_${KUTTL_VERSION}_linux_x86_64
ARG JAVA_URL=https://downloads.mesosphere.com/java/openjdk-8u212b03-hotspot-linux-x64.tar.gz
ENV JAVA_HOME=/usr/local/java
ENV PATH=$PATH:${JAVA_HOME}/bin

RUN curl -LO ${KUBECTL_DOWNLOAD_URL} && \
chmod +x ./kubectl && \
mv ./kubectl /usr/local/bin/kubectl && \
curl -L ${KUDO_DOWNLOAD_URL} -o /go/bin/kubectl-kudo && \
chmod +x /go/bin/kubectl-kudo && \
RUN apt-get update && apt-get install -y curl jq && \
pip install awscli && \
curl -L ${KUBECTL_DOWNLOAD_URL} -o /usr/local/bin/kubectl && \
curl -L ${KUDO_DOWNLOAD_URL} -o /usr/local/bin/kubectl-kudo && \
curl -L ${KUTTL_DOWNLOAD_URL} -o /usr/local/bin/kubectl-kuttl && \
for tool in kubectl*; do chmod +x /usr/local/bin/${tool}; done && \
mkdir -p /usr/local/java && \
curl -L -O ${JAVA_URL} && tar -xf openjdk-8u212b03-hotspot-linux-x64.tar.gz -C /usr/local/java --strip-components=1
5 changes: 5 additions & 0 deletions kuttl-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kudo.dev/v1alpha1
kind: TestSuite
testDirs:
- tests
timeout: 120
116 changes: 0 additions & 116 deletions tests/affinity_and_toleration_test.go

This file was deleted.

Loading

0 comments on commit d7e9ffb

Please sign in to comment.