diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 764e4d84d..b2145053d 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -7,8 +7,8 @@ on: branches: [ master ] jobs: - e2e-tests: - name: End-to-end tests + allinone-e2e-tests: + name: All in one E2E tests runs-on: ubuntu-20.04 strategy: matrix: @@ -18,22 +18,265 @@ jobs: - "1.21" - "1.22" steps: - - - name: Set up Go + - name: "Set up Go" uses: actions/setup-go@v2.1.4 with: go-version: 1.16 - - - name: Check out code into the Go module directory + - name: "Check out code into the Go module directory" uses: actions/checkout@v2.4.0 - - name: "Install KIND" run: ./.ci/install-kind.sh - - - name: "install kuttl" + - name: "Install KUTTL" run: ./.ci/install-kuttl.sh + - name: "install gomplate" + run: ./.ci/install-gomplate.sh + - name: "Install dependencies" + run: make install-tools + - name: "Run E2E test suite" + env: + KUBE_VERSION: ${{ matrix.kube-version }} + run: make run-e2e-tests-allinone + cassandra-e2e-tests: + name: Cassandra E2E tests + runs-on: ubuntu-20.04 + strategy: + matrix: + kube-version: + - "1.19" + - "1.20" + - "1.21" + - "1.22" + steps: - - name: "run tests" + - name: "Set up Go" + uses: actions/setup-go@v2.1.4 + with: + go-version: 1.16 + - name: "Check out code into the Go module directory" + uses: actions/checkout@v2.4.0 + - name: "Install KUTTL" + run: ./.ci/install-kuttl.sh + - name: "install gomplate" + run: ./.ci/install-gomplate.sh + - name: "Install dependencies" + run: make install-tools + - name: "Run E2E test suite" + env: + KUBE_VERSION: ${{ matrix.kube-version }} + run: make run-e2e-tests-cassandra + elasticsearch-e2e-tests: + name: Elasticsearch E2E tests + runs-on: ubuntu-20.04 + strategy: + matrix: + kube-version: + - "1.19" + - "1.20" + - "1.21" + - "1.22" + steps: + - name: "Set up Go" + uses: actions/setup-go@v2.1.4 + with: + go-version: 1.16 + - name: "Check out code into the Go module directory" + uses: actions/checkout@v2.4.0 + - name: "Install KUTTL" + run: ./.ci/install-kuttl.sh + - name: "install gomplate" + run: ./.ci/install-gomplate.sh + - name: "Install dependencies" + run: make install-tools + - name: "Run E2E test suite" + env: + KUBE_VERSION: ${{ matrix.kube-version }} + run: make run-e2e-tests-elasticsearch + examples-e2e-tests: + name: Examples E2E tests + runs-on: ubuntu-20.04 + strategy: + matrix: + kube-version: + - "1.19" + - "1.20" + - "1.21" + - "1.22" + steps: + - name: "Set up Go" + uses: actions/setup-go@v2.1.4 + with: + go-version: 1.16 + - name: "Check out code into the Go module directory" + uses: actions/checkout@v2.4.0 + - name: "Install KUTTL" + run: ./.ci/install-kuttl.sh + - name: "install gomplate" + run: ./.ci/install-gomplate.sh + - name: "Install dependencies" + run: make install-tools + - name: "Run E2E test suite" + env: + KUBE_VERSION: ${{ matrix.kube-version }} + run: make run-e2e-tests-examples + generate-e2e-tests: + name: Generate E2E tests + runs-on: ubuntu-20.04 + strategy: + matrix: + kube-version: + - "1.19" + - "1.20" + - "1.21" + - "1.22" + steps: + - name: "Set up Go" + uses: actions/setup-go@v2.1.4 + with: + go-version: 1.16 + - name: "Check out code into the Go module directory" + uses: actions/checkout@v2.4.0 + - name: "Install KUTTL" + run: ./.ci/install-kuttl.sh + - name: "install gomplate" + run: ./.ci/install-gomplate.sh + - name: "Install dependencies" + run: make install-tools + - name: "Run E2E test suite" + env: + KUBE_VERSION: ${{ matrix.kube-version }} + run: make run-e2e-tests-generate + istio-e2e-tests: + name: Istio E2E tests + runs-on: ubuntu-20.04 + strategy: + matrix: + kube-version: + - "1.19" + - "1.20" + - "1.21" + - "1.22" + steps: + - name: "Set up Go" + uses: actions/setup-go@v2.1.4 + with: + go-version: 1.16 + - name: "Check out code into the Go module directory" + uses: actions/checkout@v2.4.0 + - name: "Install KUTTL" + run: ./.ci/install-kuttl.sh + - name: "install gomplate" + run: ./.ci/install-gomplate.sh + - name: "Install dependencies" + run: make install-tools + - name: "Run E2E test suite" + env: + KUBE_VERSION: ${{ matrix.kube-version }} + run: make run-e2e-tests-istio + outside-cluster-e2e-tests: + name: Outside cluster E2E tests + runs-on: ubuntu-20.04 + strategy: + matrix: + kube-version: + - "1.19" + - "1.20" + - "1.21" + - "1.22" + steps: + - name: "Set up Go" + uses: actions/setup-go@v2.1.4 + with: + go-version: 1.16 + - name: "Check out code into the Go module directory" + uses: actions/checkout@v2.4.0 + - name: "Install KUTTL" + run: ./.ci/install-kuttl.sh + - name: "install gomplate" + run: ./.ci/install-gomplate.sh + - name: "Install dependencies" + run: make install-tools + - name: "Run E2E test suite" + env: + KUBE_VERSION: ${{ matrix.kube-version }} + run: make run-e2e-tests-outside-cluster + smoke-e2e-tests: + name: Smoke E2E tests + runs-on: ubuntu-20.04 + strategy: + matrix: + kube-version: + - "1.19" + - "1.20" + - "1.21" + - "1.22" + steps: + - name: "Set up Go" + uses: actions/setup-go@v2.1.4 + with: + go-version: 1.16 + - name: "Check out code into the Go module directory" + uses: actions/checkout@v2.4.0 + - name: "Install KUTTL" + run: ./.ci/install-kuttl.sh + - name: "install gomplate" + run: ./.ci/install-gomplate.sh + - name: "Install dependencies" + run: make install-tools + - name: "Run E2E test suite" + env: + KUBE_VERSION: ${{ matrix.kube-version }} + run: make run-e2e-tests-smoke + streaming-e2e-tests: + name: Streaming E2E tests + runs-on: ubuntu-20.04 + strategy: + matrix: + kube-version: + - "1.19" + - "1.20" + - "1.21" + - "1.22" + steps: + - name: "Set up Go" + uses: actions/setup-go@v2.1.4 + with: + go-version: 1.16 + - name: "Check out code into the Go module directory" + uses: actions/checkout@v2.4.0 + - name: "Install KUTTL" + run: ./.ci/install-kuttl.sh + - name: "install gomplate" + run: ./.ci/install-gomplate.sh + - name: "Install dependencies" + run: make install-tools + - name: "Run E2E test suite" + env: + KUBE_VERSION: ${{ matrix.kube-version }} + run: make run-e2e-tests-streaming + upgrade-e2e-tests: + name: Upgrade E2E tests + runs-on: ubuntu-20.04 + strategy: + matrix: + kube-version: + - "1.19" + - "1.20" + - "1.21" + - "1.22" + steps: + - name: "Set up Go" + uses: actions/setup-go@v2.1.4 + with: + go-version: 1.16 + - name: "Check out code into the Go module directory" + uses: actions/checkout@v2.4.0 + - name: "Install KUTTL" + run: ./.ci/install-kuttl.sh + - name: "install gomplate" + run: ./.ci/install-gomplate.sh + - name: "Install dependencies" + run: make install-tools + - name: "Run E2E test suite" env: KUBE_VERSION: ${{ matrix.kube-version }} - run: make install-tools e2e-tests KUBE_VERSION=$KUBE_VERSION + run: make run-e2e-tests-upgrade diff --git a/Makefile b/Makefile index 4bf84a815..7ed0905c6 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ +include tests/e2e/Makefile + # When the VERBOSE variable is set to 1, all the commands are shown -ifeq ("$(VERBOSE)","1") +ifeq ("$(VERBOSE)","true") echo_prefix=">>>>" else VECHO = @ @@ -347,7 +349,7 @@ envtest: ## Download envtest-setup locally if necessary. $(call go-get-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@latest) # go-get-tool will 'go get' any package $2 and install it to $1. -PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) +PROJECT_DIR := $(shell git rev-parse --show-toplevel) define go-get-tool @[ -f $(1) ] || { \ set -e ;\ @@ -416,164 +418,6 @@ catalog-build: opm ## Build a catalog image. catalog-push: ## Push a catalog image. $(MAKE) docker-push IMG=$(CATALOG_IMG) -# end-to-tests -.PHONY: prepare-e2e-tests -prepare-e2e-tests: kuttl set-test-image-vars set-image-controller prepare-e2e-images generate-e2e-files build render-e2e-templates - -.PHONY: generate-e2e-files -generate-e2e-files: - mkdir -p tests/_build/crds tests/_build/manifests - $(KUSTOMIZE) build config/default -o tests/_build/manifests/01-jaeger-operator.yaml - $(KUSTOMIZE) build config/crd -o tests/_build/crds/ - -.PHONY: prepare-e2e-images -prepare-e2e-images: docker build-assert-job - $(VECHO)docker pull jaegertracing/vertx-create-span:operator-e2e-tests - $(VECHO)docker pull docker.elastic.co/elasticsearch/elasticsearch-oss:6.8.6 - # Image for the upgrade E2E test - $(VECHO)docker build --build-arg=GOPROXY=${GOPROXY} --build-arg VERSION_PKG=${VERSION_PKG} --build-arg=JAEGER_VERSION=$(shell .ci/get_test_upgrade_version.sh ${JAEGER_VERSION}) --file Dockerfile -t "local/jaeger-operator:next" . - -.PHONY: render-e2e-templates -render-e2e-templates: -# This files are needed for the examples -# examples-simplest - $(VECHO)gomplate -f examples/simplest.yaml -o tests/e2e/examples-simplest/00-install.yaml - $(VECHO)JAEGER_NAME=simplest gomplate -f tests/templates/allinone-jaeger-assert.yaml.template -o tests/e2e/examples-simplest/00-assert.yaml - $(VECHO)JAEGER_SERVICE=smoketest JAEGER_OPERATION=smoketestoperation JAEGER_NAME=simplest gomplate -f tests/templates/smoke-test.yaml.template -o tests/e2e/examples-simplest/01-smoke-test.yaml - $(VECHO)gomplate -f tests/templates/smoke-test-assert.yaml.template -o tests/e2e/examples-simplest/01-assert.yaml -# examples-with-badger - $(VECHO)gomplate -f examples/with-badger.yaml -o tests/e2e/examples-with-badger/00-install.yaml - $(VECHO)JAEGER_NAME=with-badger gomplate -f tests/templates/allinone-jaeger-assert.yaml.template -o tests/e2e/examples-with-badger/00-assert.yaml - $(VECHO)JAEGER_SERVICE=with-badger JAEGER_OPERATION=smoketestoperation JAEGER_NAME=with-badger gomplate -f tests/templates/smoke-test.yaml.template -o tests/e2e/examples-with-badger/01-smoke-test.yaml - $(VECHO)gomplate -f tests/templates/smoke-test-assert.yaml.template -o tests/e2e/examples-with-badger/01-assert.yaml -# examples-with-badger-and-volume - $(VECHO)gomplate -f examples/with-badger-and-volume.yaml -o tests/e2e/examples-with-badger-and-volume/00-install.yaml - $(VECHO)JAEGER_NAME=with-badger-and-volume gomplate -f tests/templates/allinone-jaeger-assert.yaml.template -o tests/e2e/examples-with-badger-and-volume/00-assert.yaml - $(VECHO)JAEGER_SERVICE=with-badger-and-volume JAEGER_OPERATION=smoketestoperation JAEGER_NAME=with-badger-and-volume gomplate -f tests/templates/smoke-test.yaml.template -o tests/e2e/examples-with-badger-and-volume/01-smoke-test.yaml - $(VECHO)gomplate -f tests/templates/smoke-test-assert.yaml.template -o tests/e2e/examples-with-badger-and-volume/01-assert.yaml -# examples-service-types - $(VECHO)gomplate -f examples/service-types.yaml -o tests/e2e/examples-service-types/00-install.yaml - $(VECHO)JAEGER_NAME=service-types gomplate -f tests/templates/allinone-jaeger-assert.yaml.template -o tests/e2e/examples-service-types/00-assert.yaml - $(VECHO)JAEGER_SERVICE=service-types JAEGER_OPERATION=smoketestoperation JAEGER_NAME=service-types gomplate -f tests/templates/smoke-test.yaml.template -o tests/e2e/examples-service-types/01-smoke-test.yaml - $(VECHO)gomplate -f tests/templates/smoke-test-assert.yaml.template -o tests/e2e/examples-service-types/01-assert.yaml -# examples-simple-prod - $(VECHO)gomplate -f tests/templates/elasticsearch-install.yaml.template -o tests/e2e/examples-simple-prod/00-install.yaml - $(VECHO)gomplate -f tests/templates/elasticsearch-assert.yaml.template -o tests/e2e/examples-simple-prod/00-assert.yaml - $(VECHO)gomplate -f examples/simple-prod.yaml -o tests/e2e/examples-simple-prod/01-install.yaml - $(VECHO)${SED} -i "s~server-urls: http://elasticsearch.default.svc:9200~server-urls: http://elasticsearch:9200~gi" tests/e2e/examples-simple-prod/01-install.yaml - $(VECHO)JAEGER_NAME=simple-prod gomplate -f tests/templates/production-jaeger-assert.yaml.template -o tests/e2e/examples-simple-prod/01-assert.yaml - $(VECHO)JAEGER_SERVICE=simple-prod JAEGER_OPERATION=smoketestoperation JAEGER_NAME=simple-prod gomplate -f tests/templates/smoke-test.yaml.template -o tests/e2e/examples-simple-prod/02-smoke-test.yaml - $(VECHO)gomplate -f tests/templates/smoke-test-assert.yaml.template -o tests/e2e/examples-simple-prod/02-assert.yaml -# examples-simple-prod-with-volumes - $(VECHO)gomplate -f tests/templates/elasticsearch-install.yaml.template -o tests/e2e/examples-simple-prod-with-volumes/00-install.yaml - $(VECHO)gomplate -f tests/templates/elasticsearch-assert.yaml.template -o tests/e2e/examples-simple-prod-with-volumes/00-assert.yaml - $(VECHO)gomplate -f examples/simple-prod-with-volumes.yaml -o tests/e2e/examples-simple-prod-with-volumes/01-install.yaml - $(VECHO)${SED} -i "s~server-urls: http://elasticsearch.default.svc:9200~server-urls: http://elasticsearch:9200~gi" tests/e2e/examples-simple-prod-with-volumes/01-install.yaml - $(VECHO)JAEGER_NAME=simple-prod gomplate -f tests/templates/production-jaeger-assert.yaml.template -o tests/e2e/examples-simple-prod-with-volumes/01-assert.yaml - $(VECHO)JAEGER_SERVICE=simple-prod-with-volumes JAEGER_OPERATION=smoketestoperation JAEGER_NAME=simple-prod gomplate -f tests/templates/smoke-test.yaml.template -o tests/e2e/examples-simple-prod-with-volumes/02-smoke-test.yaml - $(VECHO)gomplate -f tests/templates/smoke-test-assert.yaml.template -o tests/e2e/examples-simple-prod-with-volumes/02-assert.yaml -# examples-with-sampling - $(VECHO)gomplate -f tests/templates/elasticsearch-install.yaml.template -o tests/e2e/examples-with-sampling/00-install.yaml - $(VECHO)gomplate -f tests/templates/elasticsearch-assert.yaml.template -o tests/e2e/examples-with-sampling/00-assert.yaml - $(VECHO)gomplate -f examples/with-sampling.yaml -o tests/e2e/examples-with-sampling/01-install.yaml - $(VECHO)${SED} -i "s~server-urls: http://elasticsearch.default.svc:9200~server-urls: http://elasticsearch:9200~gi" tests/e2e/examples-with-sampling/01-install.yaml - $(VECHO)JAEGER_NAME=with-sampling gomplate -f tests/templates/allinone-jaeger-assert.yaml.template -o tests/e2e/examples-with-sampling/01-assert.yaml - $(VECHO)JAEGER_SERVICE=with-sampling JAEGER_OPERATION=smoketestoperation JAEGER_NAME=with-sampling gomplate -f tests/templates/smoke-test.yaml.template -o tests/e2e/examples-with-sampling/02-smoke-test.yaml - $(VECHO)gomplate -f tests/templates/smoke-test-assert.yaml.template -o tests/e2e/examples-with-sampling/02-assert.yaml -# This is needed for the generate test - $(VECHO)@JAEGER_VERSION=${JAEGER_VERSION} gomplate -f tests/e2e/generate/jaeger-template.yaml.template -o tests/e2e/generate/jaeger-deployment.yaml -# This is needed for the upgrade test - $(VECHO)JAEGER_VERSION=${JAEGER_VERSION} gomplate -f tests/e2e/upgrade/deployment-assert.yaml.template -o tests/e2e/upgrade/00-assert.yaml - $(VECHO)JAEGER_VERSION=$(shell .ci/get_test_upgrade_version.sh ${JAEGER_VERSION}) gomplate -f tests/e2e/upgrade/deployment-assert.yaml.template -o tests/e2e/upgrade/01-assert.yaml - $(VECHO)JAEGER_VERSION=${JAEGER_VERSION} gomplate -f tests/e2e/upgrade/deployment-assert.yaml.template -o tests/e2e/upgrade/02-assert.yaml - $(VECHO)${SED} "s~local/jaeger-operator:e2e~local/jaeger-operator:next~gi" tests/_build/manifests/01-jaeger-operator.yaml > tests/e2e/upgrade/operator-upgrade.yaml -# This is needed for the streaming tests - $(VECHO)gomplate -f tests/templates/elasticsearch-install.yaml.template -o tests/e2e/streaming-simple/01-install.yaml - $(VECHO)gomplate -f tests/templates/elasticsearch-assert.yaml.template -o tests/e2e/streaming-simple/01-assert.yaml - $(VECHO)REPLICAS=1 CLUSTER_NAME=my-cluster gomplate -f tests/templates/assert-kafka-cluster.yaml.template -o tests/e2e/streaming-simple/02-assert.yaml - $(VECHO)REPLICAS=1 CLUSTER_NAME=my-cluster gomplate -f tests/templates/assert-zookeeper-cluster.yaml.template -o tests/e2e/streaming-simple/03-assert.yaml - $(VECHO)CLUSTER_NAME=my-cluster gomplate -f tests/templates/assert-entity-operator.yaml.template -o tests/e2e/streaming-simple/04-assert.yaml - $(VECHO)JAEGER_SERVICE=simple-streaming JAEGER_OPERATION=smoketestoperation JAEGER_NAME=simple-streaming gomplate -f tests/templates/smoke-test.yaml.template -o tests/e2e/streaming-simple/06-smoke-test.yaml - $(VECHO)gomplate -f tests/templates/smoke-test-assert.yaml.template -o tests/e2e/streaming-simple/06-assert.yaml -# streaming-with-tls - $(VECHO)gomplate -f tests/templates/elasticsearch-install.yaml.template -o tests/e2e/streaming-with-tls/01-install.yaml - $(VECHO)gomplate -f tests/templates/elasticsearch-assert.yaml.template -o tests/e2e/streaming-with-tls/01-assert.yaml - $(VECHO)REPLICAS=1 CLUSTER_NAME=my-cluster gomplate -f tests/templates/assert-kafka-cluster.yaml.template -o tests/e2e/streaming-with-tls/02-assert.yaml - $(VECHO)REPLICAS=1 CLUSTER_NAME=my-cluster gomplate -f tests/templates/assert-zookeeper-cluster.yaml.template -o tests/e2e/streaming-with-tls/03-assert.yaml - $(VECHO)CLUSTER_NAME=my-cluster gomplate -f tests/templates/assert-entity-operator.yaml.template -o tests/e2e/streaming-with-tls/04-assert.yaml - $(VECHO)JAEGER_SERVICE=streaming-with-tls JAEGER_OPERATION=smoketestoperation JAEGER_NAME=tls-streaming gomplate -f tests/templates/smoke-test.yaml.template -o tests/e2e/streaming-with-tls/07-smoke-test.yaml - $(VECHO)gomplate -f tests/templates/smoke-test-assert.yaml.template -o tests/e2e/streaming-with-tls/07-assert.yaml -# streaming-with-autoprovisioning - $(VECHO)gomplate -f tests/templates/elasticsearch-install.yaml.template -o tests/e2e/streaming-with-autoprovisioning/01-install.yaml - $(VECHO)gomplate -f tests/templates/elasticsearch-assert.yaml.template -o tests/e2e/streaming-with-autoprovisioning/01-assert.yaml - $(VECHO)REPLICAS=3 CLUSTER_NAME=auto-provisioned gomplate -f tests/templates/assert-zookeeper-cluster.yaml.template -o tests/e2e/streaming-with-autoprovisioning/02-assert.yaml - $(VECHO)REPLICAS=3 CLUSTER_NAME=auto-provisioned gomplate -f tests/templates/assert-kafka-cluster.yaml.template -o tests/e2e/streaming-with-autoprovisioning/03-assert.yaml - $(VECHO)CLUSTER_NAME=auto-provisioned gomplate -f tests/templates/assert-entity-operator.yaml.template -o tests/e2e/streaming-with-autoprovisioning/04-assert.yaml - $(VECHO)JAEGER_SERVICE=streaming-with-autoprovisioning JAEGER_OPERATION=smoketestoperation JAEGER_NAME=auto-provisioned gomplate -f tests/templates/smoke-test.yaml.template -o tests/e2e/streaming-with-autoprovisioning/06-smoke-test.yaml - $(VECHO)gomplate -f tests/templates/smoke-test-assert.yaml.template -o tests/e2e/streaming-with-autoprovisioning/06-assert.yaml -# examples-agent-as-daemonset - $(VECHO)gomplate -f examples/agent-as-daemonset.yaml -o tests/e2e/examples-agent-as-daemonset/00-install.yaml - $(VECHO)JAEGER_NAME=agent-as-daemonset gomplate -f tests/templates/allinone-jaeger-assert.yaml.template -o tests/e2e/examples-agent-as-daemonset/00-assert.yaml - $(VECHO)JAEGER_SERVICE=agent-as-daemonset JAEGER_OPERATION=smoketestoperation JAEGER_NAME=agent-as-daemonset gomplate -f tests/templates/smoke-test.yaml.template -o tests/e2e/examples-agent-as-daemonset/02-smoke-test.yaml - $(VECHO)gomplate -f tests/templates/smoke-test-assert.yaml.template -o tests/e2e/examples-agent-as-daemonset/02-assert.yaml -# examples-with-cassandra - $(VECHO)gomplate -f tests/templates/cassandra-install.yaml.template -o tests/e2e/examples-with-cassandra/00-install.yaml - $(VECHO)gomplate -f tests/templates/cassandra-assert.yaml.template -o tests/e2e/examples-with-cassandra/00-assert.yaml - $(VECHO)gomplate -f examples/with-cassandra.yaml -o tests/e2e/examples-with-cassandra/01-install.yaml - $(VECHO)${SED} -i "s~cassandra.default.svc~cassandra~gi" tests/e2e/examples-with-cassandra/01-install.yaml - $(VECHO)JAEGER_NAME=with-cassandra gomplate -f tests/templates/allinone-jaeger-assert.yaml.template -o tests/e2e/examples-with-cassandra/01-assert.yaml - $(VECHO)JAEGER_SERVICE=with-cassandra JAEGER_OPERATION=smoketestoperation JAEGER_NAME=with-cassandra gomplate -f tests/templates/smoke-test.yaml.template -o tests/e2e/examples-with-cassandra/02-smoke-test.yaml - $(VECHO)gomplate -f tests/templates/smoke-test-assert.yaml.template -o tests/e2e/examples-with-cassandra/02-assert.yaml -# examples-business-application-injected-sidecar - $(VECHO)cat examples/business-application-injected-sidecar.yaml tests/e2e/examples-business-application-injected-sidecar/livenessProbe.yaml > tests/e2e/examples-business-application-injected-sidecar/00-install.yaml - $(VECHO)gomplate -f examples/simplest.yaml -o tests/e2e/examples-business-application-injected-sidecar/01-install.yaml - $(VECHO)JAEGER_NAME=simplest gomplate -f tests/templates/allinone-jaeger-assert.yaml.template -o tests/e2e/examples-business-application-injected-sidecar/01-assert.yaml - $(VECHO)JAEGER_SERVICE=simplest JAEGER_OPERATION=smoketestoperation JAEGER_NAME=simplest gomplate -f tests/templates/smoke-test.yaml.template -o tests/e2e/examples-business-application-injected-sidecar/02-smoke-test.yaml - $(VECHO)gomplate -f tests/templates/smoke-test-assert.yaml.template -o tests/e2e/examples-business-application-injected-sidecar/02-assert.yaml -# istio - $(VECHO)cat examples/business-application-injected-sidecar.yaml tests/e2e/istio/livelinessprobe.template > tests/e2e/istio/03-install.yaml -# cassandra - $(VECHO)gomplate -f tests/templates/cassandra-install.yaml.template -o tests/e2e/cassandra/00-install.yaml - $(VECHO)gomplate -f tests/templates/cassandra-assert.yaml.template -o tests/e2e/cassandra/00-assert.yaml - $(VECHO)INSTANCE_NAME=with-cassandra gomplate -f tests/templates/cassandra-jaeger-install.yaml.template -o tests/e2e/cassandra/01-install.yaml - $(VECHO)INSTANCE_NAME=with-cassandra gomplate -f tests/templates/cassandra-jaeger-assert.yaml.template -o tests/e2e/cassandra/01-assert.yaml -# cassandra spark - $(VECHO) gomplate -f tests/templates/cassandra-install.yaml.template -o tests/e2e/cassandra-spark/00-install.yaml - $(VECHO) gomplate -f tests/templates/cassandra-assert.yaml.template -o tests/e2e/cassandra-spark/00-assert.yaml - $(VECHO)INSTANCE_NAME=test-spark-deps DEP_SCHEDULE=true CASSANDRA_MODE=prod gomplate -f tests/templates/cassandra-jaeger-install.yaml.template -o tests/e2e/cassandra-spark/01-install.yaml -# es-spark-dependencies - $(VECHO)gomplate -f tests/templates/elasticsearch-install.yaml.template -o tests/e2e/es-spark-dependencies/00-install.yaml - $(VECHO)gomplate -f tests/templates/elasticsearch-assert.yaml.template -o tests/e2e/es-spark-dependencies/00-assert.yaml -# es-simple-prod - $(VECHO)gomplate -f tests/templates/elasticsearch-install.yaml.template -o tests/e2e/es-simple-prod/00-install.yaml - $(VECHO)gomplate -f tests/templates/elasticsearch-assert.yaml.template -o tests/e2e/es-simple-prod/00-assert.yaml - $(VECHO)JAEGER_NAME=simple-prod gomplate -f tests/templates/production-jaeger-install.yaml.template -o tests/e2e/es-simple-prod/01-install.yaml - $(VECHO)JAEGER_NAME=simple-prod gomplate -f tests/templates/production-jaeger-assert.yaml.template -o tests/e2e/es-simple-prod/01-assert.yaml - $(VECHO)JAEGER_SERVICE=simple-prod JAEGER_OPERATION=smoketestoperation JAEGER_NAME=simple-prod gomplate -f tests/templates/smoke-test.yaml.template -o tests/e2e/es-simple-prod/02-smoke-test.yaml - $(VECHO)gomplate -f tests/templates/smoke-test-assert.yaml.template -o tests/e2e/es-simple-prod/02-assert.yaml -# es-index-cleaner - $(VECHO)gomplate -f tests/templates/elasticsearch-install.yaml.template -o tests/e2e/es-index-cleaner/00-install.yaml - $(VECHO)gomplate -f tests/templates/elasticsearch-assert.yaml.template -o tests/e2e/es-index-cleaner/00-assert.yaml - $(VECHO)JAEGER_NAME=test-es-index-cleaner-with-prefix gomplate -f tests/templates/production-jaeger-install.yaml.template -o tests/e2e/es-index-cleaner/jaeger-deployment - $(VECHO)gomplate -f tests/e2e/es-index-cleaner/es-index.template -o tests/e2e/es-index-cleaner/es-index - $(VECHO)cat tests/e2e/es-index-cleaner/jaeger-deployment tests/e2e/es-index-cleaner/es-index >> tests/e2e/es-index-cleaner/01-install.yaml - $(VECHO)JAEGER_NAME=test-es-index-cleaner-with-prefix gomplate -f tests/templates/production-jaeger-assert.yaml.template -o tests/e2e/es-index-cleaner/01-assert.yaml - $(VECHO)$(SED) "s~enabled: false~enabled: true~gi" tests/e2e/es-index-cleaner/01-install.yaml > tests/e2e/es-index-cleaner/03-install.yaml - $(VECHO)gomplate -f tests/e2e/es-index-cleaner/01-install.yaml -o tests/e2e/es-index-cleaner/05-install.yaml - $(VECHO)PREFIX=my-prefix gomplate -f tests/e2e/es-index-cleaner/es-index.template -o tests/e2e/es-index-cleaner/es-index2 - $(VECHO)cat tests/e2e/es-index-cleaner/jaeger-deployment tests/e2e/es-index-cleaner/es-index2 >> tests/e2e/es-index-cleaner/07-install.yaml - $(VECHO)$(SED) "s~enabled: false~enabled: true~gi" tests/e2e/es-index-cleaner/07-install.yaml > tests/e2e/es-index-cleaner/09-install.yaml - $(VECHO)gomplate -f tests/e2e/es-index-cleaner/04-wait-es-index-cleaner.yaml -o tests/e2e/es-index-cleaner/11-wait-es-index-cleaner.yaml - $(VECHO)gomplate -f tests/e2e/es-index-cleaner/05-install.yaml -o tests/e2e/es-index-cleaner/12-install.yaml - -# end-to-tests -.PHONY: e2e-tests -e2e-tests: prepare-e2e-tests start-kind run-e2e-tests - -.PHONY: run-e2e-tests -run-e2e-tests: - $(VECHO)$(KUTTL) test - .PHONY: start-kind start-kind: kind # Instead of letting KUTTL create the Kind cluster (using the CLI or in the kuttl-tests.yaml @@ -592,19 +436,14 @@ start-kind: kind $(VECHO)$(KIND) load docker-image local/jaeger-operator:next $(VECHO)$(KIND) load docker-image docker.elastic.co/elasticsearch/elasticsearch-oss:6.8.6 -.PHONY: build-assert-job -build-assert-job: - $(VECHO)docker build -t local/asserts:e2e -f Dockerfile.asserts . - +stop-kind: + $(ECHO)Stopping the kind cluster + $(VECHO)kind delete cluster -.PHONY: build-assert-job +.PHONY: install-git-hooks install-git-hooks: $(VECHO)cp scripts/git-hooks/pre-commit .git/hooks -set-test-image-vars: - $(eval IMG=local/jaeger-operator:e2e) - - # Generates the released manifests release-artifacts: set-image-controller mkdir -p dist @@ -629,7 +468,6 @@ else KUTTL=$(shell which kubectl-kuttl) endif - # Set the controller image parameters set-image-controller: manifests kustomize cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} diff --git a/tests/assert-jobs/query/main.go b/tests/assert-jobs/query/main.go index a4899b29d..f98186150 100644 --- a/tests/assert-jobs/query/main.go +++ b/tests/assert-jobs/query/main.go @@ -31,7 +31,7 @@ const ( func main() { viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_")) viper.AutomaticEnv() - viper.SetDefault(flagIngressHost, "localhost") + viper.SetDefault(flagIngressHost, "http://localhost") flag.String(flagIngressHost, "", "Query service hostname") flag.String(flagServiceName, "", "Service name expected") pflag.CommandLine.AddGoFlagSet(flag.CommandLine) @@ -47,7 +47,7 @@ func main() { host := viper.GetString(flagIngressHost) serviceName := viper.GetString(flagServiceName) - url := fmt.Sprintf("http://%s/api/services", host) + url := fmt.Sprintf("%s/api/services", host) err = utils.TestGetHTTP(url, params, func(response *http.Response, body []byte) (done bool, err error) { resp := &services{} diff --git a/tests/e2e/Makefile b/tests/e2e/Makefile new file mode 100644 index 000000000..ee4dd073f --- /dev/null +++ b/tests/e2e/Makefile @@ -0,0 +1,58 @@ +include tests/e2e/allinone/Makefile +include tests/e2e/cassandra/Makefile +include tests/e2e/elasticsearch/Makefile +include tests/e2e/examples/Makefile +include tests/e2e/generate/Makefile +include tests/e2e/istio/Makefile +include tests/e2e/outside-cluster/Makefile +include tests/e2e/sidecard/Makefile +include tests/e2e/smoke/Makefile +include tests/e2e/streaming/Makefile +include tests/e2e/upgrade/Makefile + +.PHONY: prepare-e2e-tests +prepare-e2e-tests: IMG=local/jaeger-operator:e2e +prepare-e2e-tests: kuttl build prepare-e2e-images generate-e2e-files + +.PHONY: build-assert-job +build-assert-job: + $(VECHO)docker build -t local/asserts:e2e -f Dockerfile.asserts . + +.PHONY: generate-e2e-files +generate-e2e-files: set-image-controller + mkdir -p tests/_build/crds tests/_build/manifests + $(KUSTOMIZE) build config/default -o tests/_build/manifests/01-jaeger-operator.yaml + $(KUSTOMIZE) build config/crd -o tests/_build/crds/ + +.PHONY: prepare-e2e-images +prepare-e2e-images: +prepare-e2e-images: docker build-assert-job + $(VECHO)docker pull jaegertracing/vertx-create-span:operator-e2e-tests + $(VECHO)docker pull docker.elastic.co/elasticsearch/elasticsearch-oss:6.8.6 + + # Image for the upgrade E2E test + $(VECHO)docker build --build-arg=GOPROXY=${GOPROXY} --build-arg VERSION_PKG=${VERSION_PKG} --build-arg=JAEGER_VERSION=$(shell .ci/get_test_upgrade_version.sh ${JAEGER_VERSION}) --file Dockerfile -t "local/jaeger-operator:next" . + +.PHONY: run-e2e-tests +run-e2e-tests: list-test-suites + $(VECHO) for suite in $(TEST_SUITES); do \ + $(MAKE) run-e2e-tests-$$suite ; \ + done + +.PHONY: render-e2e-tests +render-e2e-tests: generate-e2e-files list-test-suites + $(VECHO) for suite in $(TEST_SUITES); do \ + $(MAKE) render-e2e-tests-$$suite ; \ + done + +.PHONY: list-test-suites +list-test-suites: + $(VECHO)$(eval TEST_SUITES := $(shell find tests/e2e -name Makefile | grep -E -o '(\w|\-)*' | grep -v 'test' | grep -v 'Makefile' | grep -v 'e2e')) + +run-suite-tests: + $(VECHO)$(MAKE) prepare-e2e-tests render-e2e-tests-$(TEST_SUITE_NAME) start-kind + $(VECHO)cd tests/e2e/$(TEST_SUITE_NAME) && $(KUTTL) test $(KUTTL_OPTIONS) + $(VECHO)$(MAKE) stop-kind + +generate-kuttl-config: + $(VECHO)gomplate -f tests/templates/kuttl-test.yaml -o tests/e2e/$(TEST_SUITE_NAME)/kuttl-test.yaml diff --git a/tests/e2e/allinone-ingress/00-assert.yaml b/tests/e2e/allinone-ingress/00-assert.yaml deleted file mode 100644 index 77db0ca4c..000000000 --- a/tests/e2e/allinone-ingress/00-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -# Assert there is an ingress entry for the Jaeger query -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: my-jaeger-query -status: - loadBalancer: - ingress: - - hostname: localhost diff --git a/tests/e2e/allinone-ingress/01-assert.yaml b/tests/e2e/allinone-ingress/01-assert.yaml deleted file mode 100644 index 3b011f3ac..000000000 --- a/tests/e2e/allinone-ingress/01-assert.yaml +++ /dev/null @@ -1,7 +0,0 @@ -# Assert the spans are reported -apiVersion: batch/v1 -kind: Job -metadata: - name: report-span -status: - succeeded: 1 diff --git a/tests/e2e/allinone-ingress/01-report-span.yaml b/tests/e2e/allinone-ingress/01-report-span.yaml deleted file mode 100644 index 9ec7bb221..000000000 --- a/tests/e2e/allinone-ingress/01-report-span.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# Report some spans -apiVersion: batch/v1 -kind: Job -metadata: - name: report-span -spec: - template: - spec: - containers: - - name: asserts-container - image: local/asserts:e2e - command: ["./reporter"] - env: - - name: JAEGER_SERVICE_NAME - value: "my-test-service" - - name: OPERATION_NAME - value: "my-little-op" - - name: JAEGER_ENDPOINT - value: "http://my-jaeger-collector-headless:14268/api/traces" - - name: JAEGER_QUERY - value: "http://my-jaeger-query:16686/api/traces" - restartPolicy: OnFailure - backoffLimit: 10 diff --git a/tests/e2e/allinone-ingress/02-check-ingress.yaml b/tests/e2e/allinone-ingress/02-check-ingress.yaml deleted file mode 100644 index 427f7544f..000000000 --- a/tests/e2e/allinone-ingress/02-check-ingress.yaml +++ /dev/null @@ -1,6 +0,0 @@ -# Check the spans were reported successfully and Jaeger query is reachable from -# localhost -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - script: "go run ../../assert-jobs/query/main.go --service-name=my-test-service" diff --git a/tests/e2e/allinone-uidefinition/00-install.yaml b/tests/e2e/allinone-uidefinition/00-install.yaml deleted file mode 100644 index 9ea71e062..000000000 --- a/tests/e2e/allinone-uidefinition/00-install.yaml +++ /dev/null @@ -1,34 +0,0 @@ -apiVersion: jaegertracing.io/v1 -kind: Jaeger -metadata: - name: all-in-one-with-ui-config -spec: - strategy: allinone - allInOne: - options: - query.base-path: "/jaeger" - ui: - options: - tracking: - gaID: "MyTrackingId" ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: test-ui-config -spec: - template: - spec: - containers: - - name: asserts-container - image: local/asserts:e2e - command: ["./uiconfig"] - env: - - name: QUERY_HOSTNAME - value: "all-in-one-with-ui-config-query" - - name: QUERY_BASE_PATH - value: "jaeger" - - name: TRACKING-ID - value: "MyTrackingId" - restartPolicy: Never - backoffLimit: 1 diff --git a/tests/e2e/allinone/.gitignore b/tests/e2e/allinone/.gitignore new file mode 100644 index 000000000..e7b239632 --- /dev/null +++ b/tests/e2e/allinone/.gitignore @@ -0,0 +1 @@ +kuttl-test.yaml diff --git a/tests/e2e/allinone/Makefile b/tests/e2e/allinone/Makefile new file mode 100644 index 000000000..b615e2ddf --- /dev/null +++ b/tests/e2e/allinone/Makefile @@ -0,0 +1,6 @@ +render-e2e-tests-allinone: TEST_SUITE_NAME=allinone +render-e2e-tests-allinone: generate-kuttl-config + ./tests/e2e/allinone/render.sh + +run-e2e-tests-allinone: TEST_SUITE_NAME=allinone +run-e2e-tests-allinone: run-suite-tests diff --git a/tests/e2e/allinone/allinone-ingress/.gitignore b/tests/e2e/allinone/allinone-ingress/.gitignore new file mode 100644 index 000000000..e914774e6 --- /dev/null +++ b/tests/e2e/allinone/allinone-ingress/.gitignore @@ -0,0 +1,5 @@ +01-report-span.yaml +01-assert.yaml +02-assert.yaml +03-check-route.yaml +ensure-ingress-host.sh diff --git a/tests/e2e/allinone/allinone-ingress/00-assert.yaml b/tests/e2e/allinone/allinone-ingress/00-assert.yaml new file mode 100644 index 000000000..9737852ff --- /dev/null +++ b/tests/e2e/allinone/allinone-ingress/00-assert.yaml @@ -0,0 +1,7 @@ +# Assert there is a running Jaeger instance +apiVersion: apps/v1 +kind: Deployment +metadata: + name: my-jaeger +spec: + replicas: 1 diff --git a/tests/e2e/allinone-ingress/00-install.yaml b/tests/e2e/allinone/allinone-ingress/00-install.yaml similarity index 100% rename from tests/e2e/allinone-ingress/00-install.yaml rename to tests/e2e/allinone/allinone-ingress/00-install.yaml diff --git a/tests/e2e/allinone/00-assert.yaml b/tests/e2e/allinone/allinone-smoke/00-assert.yaml similarity index 100% rename from tests/e2e/allinone/00-assert.yaml rename to tests/e2e/allinone/allinone-smoke/00-assert.yaml diff --git a/tests/e2e/allinone/00-install.yaml b/tests/e2e/allinone/allinone-smoke/00-install.yaml similarity index 100% rename from tests/e2e/allinone/00-install.yaml rename to tests/e2e/allinone/allinone-smoke/00-install.yaml diff --git a/tests/e2e/allinone/allinone-uidefinition/.gitignore b/tests/e2e/allinone/allinone-uidefinition/.gitignore new file mode 100644 index 000000000..d0503877e --- /dev/null +++ b/tests/e2e/allinone/allinone-uidefinition/.gitignore @@ -0,0 +1 @@ +01-install.yaml diff --git a/tests/e2e/allinone/allinone-uidefinition/00-assert.yaml b/tests/e2e/allinone/allinone-uidefinition/00-assert.yaml new file mode 100644 index 000000000..4faef65ce --- /dev/null +++ b/tests/e2e/allinone/allinone-uidefinition/00-assert.yaml @@ -0,0 +1,6 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: all-in-one-with-ui-config +spec: + replicas: 1 diff --git a/tests/e2e/allinone/allinone-uidefinition/00-install.yaml b/tests/e2e/allinone/allinone-uidefinition/00-install.yaml new file mode 100644 index 000000000..3ff037285 --- /dev/null +++ b/tests/e2e/allinone/allinone-uidefinition/00-install.yaml @@ -0,0 +1,13 @@ +apiVersion: jaegertracing.io/v1 +kind: Jaeger +metadata: + name: all-in-one-with-ui-config +spec: + strategy: allinone + allInOne: + options: + query.base-path: "/jaeger" + ui: + options: + tracking: + gaID: "MyTrackingId" diff --git a/tests/e2e/allinone-uidefinition/00-assert.yaml b/tests/e2e/allinone/allinone-uidefinition/01-assert.yaml similarity index 100% rename from tests/e2e/allinone-uidefinition/00-assert.yaml rename to tests/e2e/allinone/allinone-uidefinition/01-assert.yaml diff --git a/tests/e2e/allinone/render.sh b/tests/e2e/allinone/render.sh new file mode 100755 index 000000000..c601af89f --- /dev/null +++ b/tests/e2e/allinone/render.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +source $(dirname "$0")/../render-utils.sh + +cd $SUITE_DIR + +export JAEGER_SERVICE=my-test-service +export JAEGER_OPERATION=my-little-op +export JAEGER_NAME=my-jaeger + +echo "Rendering templates for allinone-ingress test" +cd allinone-ingress +$GOMPLATE -f $TEMPLATES_DIR/smoke-test.yaml.template -o ./01-report-span.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test-assert.yaml.template -o ./01-assert.yaml + +export DESTINATION_NAME=$JAEGER_NAME-query + +# This variable is used to generate 03-check-route.yaml +export GET_URL_COMMAND +export ROUTE_NAME=$JAEGER_NAME +export QUERY_HOST + +ROUTE_NAME=$JAEGER_NAME-query +$GOMPLATE -f $TEMPLATES_DIR/assert-ingress.yaml.template -o ./02-assert.yaml +GET_URL_COMMAND="kubectl get ingress $JAEGER_NAME-query -o=jsonpath='{.status.loadBalancer.ingress[0].hostname}' -n \$NAMESPACE" +QUERY_HOST="http://\$($GET_URL_COMMAND)" + +$GOMPLATE -f $TEMPLATES_DIR/ensure-ingress-host.sh.template -o ./ensure-ingress-host.sh +chmod +x ./ensure-ingress-host.sh +$GOMPLATE -f $TEMPLATES_DIR/find-service-from-client.yaml.template -o ./03-check-route.yaml + +cd .. + +echo "Rendering templates for allinone-uidefinition test" +cd allinone-uidefinition +export QUERY_HOSTNAME=all-in-one-with-ui-config-query +export QUERY_BASE_PATH=jaeger +export TRACKING_ID=MyTrackingId +$GOMPLATE -f $TEMPLATES_DIR/test-uiconfig.yaml.template -o ./01-install.yaml diff --git a/tests/e2e/cassandra/.gitignore b/tests/e2e/cassandra/.gitignore index 7066d5459..e7b239632 100644 --- a/tests/e2e/cassandra/.gitignore +++ b/tests/e2e/cassandra/.gitignore @@ -1,4 +1 @@ -00-install.yaml -00-assert.yaml -01-install.yaml -01-assert.yaml +kuttl-test.yaml diff --git a/tests/e2e/cassandra/Makefile b/tests/e2e/cassandra/Makefile new file mode 100644 index 000000000..cdd4c6877 --- /dev/null +++ b/tests/e2e/cassandra/Makefile @@ -0,0 +1,6 @@ +render-e2e-tests-cassandra: TEST_SUITE_NAME=cassandra +render-e2e-tests-cassandra: generate-kuttl-config + ./tests/e2e/cassandra/render.sh + +run-e2e-tests-cassandra: TEST_SUITE_NAME=cassandra +run-e2e-tests-cassandra: run-suite-tests diff --git a/tests/e2e/cassandra/cassandra-smoke/.gitignore b/tests/e2e/cassandra/cassandra-smoke/.gitignore new file mode 100644 index 000000000..7066d5459 --- /dev/null +++ b/tests/e2e/cassandra/cassandra-smoke/.gitignore @@ -0,0 +1,4 @@ +00-install.yaml +00-assert.yaml +01-install.yaml +01-assert.yaml diff --git a/tests/e2e/cassandra/02-assert.yaml b/tests/e2e/cassandra/cassandra-smoke/02-assert.yaml similarity index 100% rename from tests/e2e/cassandra/02-assert.yaml rename to tests/e2e/cassandra/cassandra-smoke/02-assert.yaml diff --git a/tests/e2e/cassandra/02-generate-spans.yaml b/tests/e2e/cassandra/cassandra-smoke/02-generate-spans.yaml similarity index 100% rename from tests/e2e/cassandra/02-generate-spans.yaml rename to tests/e2e/cassandra/cassandra-smoke/02-generate-spans.yaml diff --git a/tests/e2e/cassandra-spark/.gitignore b/tests/e2e/cassandra/cassandra-spark/.gitignore similarity index 100% rename from tests/e2e/cassandra-spark/.gitignore rename to tests/e2e/cassandra/cassandra-spark/.gitignore diff --git a/tests/e2e/cassandra-spark/01-assert.yaml b/tests/e2e/cassandra/cassandra-spark/01-assert.yaml similarity index 100% rename from tests/e2e/cassandra-spark/01-assert.yaml rename to tests/e2e/cassandra/cassandra-spark/01-assert.yaml diff --git a/tests/e2e/cassandra/render.sh b/tests/e2e/cassandra/render.sh new file mode 100755 index 000000000..b52cf7e5c --- /dev/null +++ b/tests/e2e/cassandra/render.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +source $(dirname "$0")/../render-utils.sh + +cd $SUITE_DIR + +echo "Rendering templates for cassandra-smoke test" +cd cassandra-smoke +export CASSANDRA_INSTANCE_NAME=with-cassandra +export JAEGER_NAME=with-cassandra +export JAEGER_SERVICE=with-cassandra +export JAEGER_OPERATION=smoketestoperation +$GOMPLATE -f $TEMPLATES_DIR/cassandra-install.yaml.template -o ./00-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/cassandra-assert.yaml.template -o ./00-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/cassandra-jaeger-install.yaml.template -o ./01-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/cassandra-jaeger-assert.yaml.template -o ./01-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test.yaml.template -o ./02-smoke-test.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test-assert.yaml.template -o ./02-assert.yaml + +cd ../ + +echo "Rendering templates for cassandra-spark test" +cd cassandra-spark +export CASSANDRA_INSTANCE_NAME=test-spark-deps +export DEP_SCHEDULE=true +export CASSANDRA_MODE=prod +$GOMPLATE -f $TEMPLATES_DIR/cassandra-install.yaml.template -o ./00-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/cassandra-assert.yaml.template -o ./00-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/cassandra-jaeger-install.yaml.template -o ./01-install.yaml diff --git a/tests/e2e/elasticsearch/.gitignore b/tests/e2e/elasticsearch/.gitignore new file mode 100644 index 000000000..e7b239632 --- /dev/null +++ b/tests/e2e/elasticsearch/.gitignore @@ -0,0 +1 @@ +kuttl-test.yaml diff --git a/tests/e2e/elasticsearch/Makefile b/tests/e2e/elasticsearch/Makefile new file mode 100644 index 000000000..0afdab7d5 --- /dev/null +++ b/tests/e2e/elasticsearch/Makefile @@ -0,0 +1,6 @@ +render-e2e-tests-elasticsearch: TEST_SUITE_NAME=elasticsearch +render-e2e-tests-elasticsearch: generate-kuttl-config + ./tests/e2e/elasticsearch/render.sh + +run-e2e-tests-elasticsearch: TEST_SUITE_NAME=elasticsearch +run-e2e-tests-elasticsearch: run-suite-tests diff --git a/tests/e2e/es-index-cleaner/.gitignore b/tests/e2e/elasticsearch/es-index-cleaner/.gitignore similarity index 100% rename from tests/e2e/es-index-cleaner/.gitignore rename to tests/e2e/elasticsearch/es-index-cleaner/.gitignore diff --git a/tests/e2e/es-index-cleaner/02-assert.yaml b/tests/e2e/elasticsearch/es-index-cleaner/02-assert.yaml similarity index 100% rename from tests/e2e/es-index-cleaner/02-assert.yaml rename to tests/e2e/elasticsearch/es-index-cleaner/02-assert.yaml diff --git a/tests/e2e/es-index-cleaner/02-generate-spans.yaml b/tests/e2e/elasticsearch/es-index-cleaner/02-generate-spans.yaml similarity index 100% rename from tests/e2e/es-index-cleaner/02-generate-spans.yaml rename to tests/e2e/elasticsearch/es-index-cleaner/02-generate-spans.yaml diff --git a/tests/e2e/es-index-cleaner/04-assert.yaml b/tests/e2e/elasticsearch/es-index-cleaner/04-assert.yaml similarity index 100% rename from tests/e2e/es-index-cleaner/04-assert.yaml rename to tests/e2e/elasticsearch/es-index-cleaner/04-assert.yaml diff --git a/tests/e2e/elasticsearch/es-index-cleaner/04-wait-es-index-cleaner.yaml b/tests/e2e/elasticsearch/es-index-cleaner/04-wait-es-index-cleaner.yaml new file mode 100644 index 000000000..a877fdec7 --- /dev/null +++ b/tests/e2e/elasticsearch/es-index-cleaner/04-wait-es-index-cleaner.yaml @@ -0,0 +1,5 @@ +# Wait for a new execution of the cronjob +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: "go run ../../../cmd-utils/wait-cronjob/main.go --cronjob test-es-index-cleaner-with-prefix-es-index-cleaner --namespace $NAMESPACE" diff --git a/tests/e2e/es-index-cleaner/06-assert.yaml b/tests/e2e/elasticsearch/es-index-cleaner/06-assert.yaml similarity index 100% rename from tests/e2e/es-index-cleaner/06-assert.yaml rename to tests/e2e/elasticsearch/es-index-cleaner/06-assert.yaml diff --git a/tests/e2e/es-index-cleaner/06-check-indices.yaml b/tests/e2e/elasticsearch/es-index-cleaner/06-check-indices.yaml similarity index 100% rename from tests/e2e/es-index-cleaner/06-check-indices.yaml rename to tests/e2e/elasticsearch/es-index-cleaner/06-check-indices.yaml diff --git a/tests/e2e/es-index-cleaner/es-index.template b/tests/e2e/elasticsearch/es-index-cleaner/es-index.template similarity index 100% rename from tests/e2e/es-index-cleaner/es-index.template rename to tests/e2e/elasticsearch/es-index-cleaner/es-index.template diff --git a/tests/e2e/es-rollover/00-assert.yaml b/tests/e2e/elasticsearch/es-rollover/00-assert.yaml similarity index 100% rename from tests/e2e/es-rollover/00-assert.yaml rename to tests/e2e/elasticsearch/es-rollover/00-assert.yaml diff --git a/tests/e2e/es-rollover/00-install.yaml b/tests/e2e/elasticsearch/es-rollover/00-install.yaml similarity index 100% rename from tests/e2e/es-rollover/00-install.yaml rename to tests/e2e/elasticsearch/es-rollover/00-install.yaml diff --git a/tests/e2e/es-rollover/01-assert.yaml b/tests/e2e/elasticsearch/es-rollover/01-assert.yaml similarity index 100% rename from tests/e2e/es-rollover/01-assert.yaml rename to tests/e2e/elasticsearch/es-rollover/01-assert.yaml diff --git a/tests/e2e/es-rollover/01-generate-spans.yaml b/tests/e2e/elasticsearch/es-rollover/01-generate-spans.yaml similarity index 100% rename from tests/e2e/es-rollover/01-generate-spans.yaml rename to tests/e2e/elasticsearch/es-rollover/01-generate-spans.yaml diff --git a/tests/e2e/es-rollover/02-assert.yaml b/tests/e2e/elasticsearch/es-rollover/02-assert.yaml similarity index 100% rename from tests/e2e/es-rollover/02-assert.yaml rename to tests/e2e/elasticsearch/es-rollover/02-assert.yaml diff --git a/tests/e2e/es-rollover/02-check-es-status.yaml b/tests/e2e/elasticsearch/es-rollover/02-check-es-status.yaml similarity index 100% rename from tests/e2e/es-rollover/02-check-es-status.yaml rename to tests/e2e/elasticsearch/es-rollover/02-check-es-status.yaml diff --git a/tests/e2e/es-rollover/03-assert.yaml b/tests/e2e/elasticsearch/es-rollover/03-assert.yaml similarity index 100% rename from tests/e2e/es-rollover/03-assert.yaml rename to tests/e2e/elasticsearch/es-rollover/03-assert.yaml diff --git a/tests/e2e/es-rollover/03-install.yaml b/tests/e2e/elasticsearch/es-rollover/03-install.yaml similarity index 100% rename from tests/e2e/es-rollover/03-install.yaml rename to tests/e2e/elasticsearch/es-rollover/03-install.yaml diff --git a/tests/e2e/es-rollover/04-assert.yaml b/tests/e2e/elasticsearch/es-rollover/04-assert.yaml similarity index 100% rename from tests/e2e/es-rollover/04-assert.yaml rename to tests/e2e/elasticsearch/es-rollover/04-assert.yaml diff --git a/tests/e2e/es-rollover/04-generate-spans.yaml b/tests/e2e/elasticsearch/es-rollover/04-generate-spans.yaml similarity index 100% rename from tests/e2e/es-rollover/04-generate-spans.yaml rename to tests/e2e/elasticsearch/es-rollover/04-generate-spans.yaml diff --git a/tests/e2e/es-rollover/05-assert.yaml b/tests/e2e/elasticsearch/es-rollover/05-assert.yaml similarity index 100% rename from tests/e2e/es-rollover/05-assert.yaml rename to tests/e2e/elasticsearch/es-rollover/05-assert.yaml diff --git a/tests/e2e/es-rollover/05-check-indices.yaml b/tests/e2e/elasticsearch/es-rollover/05-check-indices.yaml similarity index 100% rename from tests/e2e/es-rollover/05-check-indices.yaml rename to tests/e2e/elasticsearch/es-rollover/05-check-indices.yaml diff --git a/tests/e2e/es-rollover/06-assert.yaml b/tests/e2e/elasticsearch/es-rollover/06-assert.yaml similarity index 100% rename from tests/e2e/es-rollover/06-assert.yaml rename to tests/e2e/elasticsearch/es-rollover/06-assert.yaml diff --git a/tests/e2e/es-rollover/06-generate-spans.yaml b/tests/e2e/elasticsearch/es-rollover/06-generate-spans.yaml similarity index 100% rename from tests/e2e/es-rollover/06-generate-spans.yaml rename to tests/e2e/elasticsearch/es-rollover/06-generate-spans.yaml diff --git a/tests/e2e/elasticsearch/es-rollover/07-wait-rollover.yaml b/tests/e2e/elasticsearch/es-rollover/07-wait-rollover.yaml new file mode 100644 index 000000000..133d0f01d --- /dev/null +++ b/tests/e2e/elasticsearch/es-rollover/07-wait-rollover.yaml @@ -0,0 +1,4 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: "go run ../../../cmd-utils/wait-cronjob/main.go --cronjob my-jaeger-es-rollover --namespace $NAMESPACE" diff --git a/tests/e2e/es-rollover/08-assert.yaml b/tests/e2e/elasticsearch/es-rollover/08-assert.yaml similarity index 100% rename from tests/e2e/es-rollover/08-assert.yaml rename to tests/e2e/elasticsearch/es-rollover/08-assert.yaml diff --git a/tests/e2e/es-rollover/08-check-indices.yaml b/tests/e2e/elasticsearch/es-rollover/08-check-indices.yaml similarity index 100% rename from tests/e2e/es-rollover/08-check-indices.yaml rename to tests/e2e/elasticsearch/es-rollover/08-check-indices.yaml diff --git a/tests/e2e/es-simple-prod/.gitignore b/tests/e2e/elasticsearch/es-simple-prod/.gitignore similarity index 100% rename from tests/e2e/es-simple-prod/.gitignore rename to tests/e2e/elasticsearch/es-simple-prod/.gitignore diff --git a/tests/e2e/es-spark-dependencies/.gitignore b/tests/e2e/elasticsearch/es-spark-dependencies/.gitignore similarity index 100% rename from tests/e2e/es-spark-dependencies/.gitignore rename to tests/e2e/elasticsearch/es-spark-dependencies/.gitignore diff --git a/tests/e2e/es-spark-dependencies/01-assert.yaml b/tests/e2e/elasticsearch/es-spark-dependencies/01-assert.yaml similarity index 100% rename from tests/e2e/es-spark-dependencies/01-assert.yaml rename to tests/e2e/elasticsearch/es-spark-dependencies/01-assert.yaml diff --git a/tests/e2e/es-spark-dependencies/01-install.yaml b/tests/e2e/elasticsearch/es-spark-dependencies/01-install.yaml similarity index 100% rename from tests/e2e/es-spark-dependencies/01-install.yaml rename to tests/e2e/elasticsearch/es-spark-dependencies/01-install.yaml diff --git a/tests/e2e/elasticsearch/es-spark-dependencies/02-wait-spark-dependencies.yaml b/tests/e2e/elasticsearch/es-spark-dependencies/02-wait-spark-dependencies.yaml new file mode 100644 index 000000000..1a13297e1 --- /dev/null +++ b/tests/e2e/elasticsearch/es-spark-dependencies/02-wait-spark-dependencies.yaml @@ -0,0 +1,5 @@ +# Wait for the next execution of the cronjob +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: "go run ../../../cmd-utils/wait-cronjob/main.go --cronjob my-jaeger-spark-dependencies --namespace $NAMESPACE" diff --git a/tests/e2e/elasticsearch/render.sh b/tests/e2e/elasticsearch/render.sh new file mode 100755 index 000000000..0732b658d --- /dev/null +++ b/tests/e2e/elasticsearch/render.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +source $(dirname "$0")/../render-utils.sh + +cd $SUITE_DIR + +echo "Rendering templates for es-index-cleaner test" +cd es-index-cleaner +export JAEGER_NAME=test-es-index-cleaner-with-prefix +export PREFIX=my-prefix +$GOMPLATE -f $TEMPLATES_DIR/elasticsearch-install.yaml.template -o ./00-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/elasticsearch-assert.yaml.template -o ./00-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/production-jaeger-install.yaml.template -o ./jaeger-deployment +$GOMPLATE -f ./es-index.template -o ./es-index +cat ./jaeger-deployment ./es-index >> ./01-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/production-jaeger-assert.yaml.template -o ./01-assert.yaml +sed "s~enabled: false~enabled: true~gi" ./01-install.yaml > ./03-install.yaml +$GOMPLATE -f ./01-install.yaml -o ./05-install.yaml +$GOMPLATE -f ./es-index.template -o ./es-index2 +cat ./jaeger-deployment ./es-index2 >> ./07-install.yaml +sed "s~enabled: false~enabled: true~gi" ./07-install.yaml > ./09-install.yaml +$GOMPLATE -f ./04-wait-es-index-cleaner.yaml -o ./11-wait-es-index-cleaner.yaml +$GOMPLATE -f ./05-install.yaml -o ./12-install.yaml + +cd .. + +echo "Rendering templates for es-simple-prod test" +cd es-simple-prod +export JAEGER_NAME=simple-prod +export JAEGER_SERVICE=simple-prod +export JAEGER_OPERATION=smoketestoperation +$GOMPLATE -f $TEMPLATES_DIR/elasticsearch-install.yaml.template -o ./00-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/elasticsearch-assert.yaml.template -o ./00-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/production-jaeger-install.yaml.template -o ./01-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/production-jaeger-assert.yaml.template -o ./01-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test.yaml.template -o ./02-smoke-test.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test-assert.yaml.template -o ./02-assert.yaml + +cd .. + +echo "Rendering templates for es-spark-dependencies test" +cd es-spark-dependencies +$GOMPLATE -f $TEMPLATES_DIR/elasticsearch-install.yaml.template -o ./00-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/elasticsearch-assert.yaml.template -o ./00-assert.yaml diff --git a/tests/e2e/es-index-cleaner/04-wait-es-index-cleaner.yaml b/tests/e2e/es-index-cleaner/04-wait-es-index-cleaner.yaml deleted file mode 100644 index 453a18ef0..000000000 --- a/tests/e2e/es-index-cleaner/04-wait-es-index-cleaner.yaml +++ /dev/null @@ -1,5 +0,0 @@ -# Wait for a new execution of the cronjob -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - script: "go run ../../cmd-utils/wait-cronjob/main.go --cronjob test-es-index-cleaner-with-prefix-es-index-cleaner --namespace $NAMESPACE" diff --git a/tests/e2e/es-rollover/07-wait-rollover.yaml b/tests/e2e/es-rollover/07-wait-rollover.yaml deleted file mode 100644 index aeef263f4..000000000 --- a/tests/e2e/es-rollover/07-wait-rollover.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - script: "go run ../../cmd-utils/wait-cronjob/main.go --cronjob my-jaeger-es-rollover --namespace $NAMESPACE" diff --git a/tests/e2e/es-spark-dependencies/02-wait-spark-dependencies.yaml b/tests/e2e/es-spark-dependencies/02-wait-spark-dependencies.yaml deleted file mode 100644 index 029824260..000000000 --- a/tests/e2e/es-spark-dependencies/02-wait-spark-dependencies.yaml +++ /dev/null @@ -1,5 +0,0 @@ -# Wait for the next execution of the cronjob -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - script: "go run ../../cmd-utils/wait-cronjob/main.go --cronjob my-jaeger-spark-dependencies --namespace $NAMESPACE" diff --git a/tests/e2e/examples/.gitignore b/tests/e2e/examples/.gitignore new file mode 100644 index 000000000..e7b239632 --- /dev/null +++ b/tests/e2e/examples/.gitignore @@ -0,0 +1 @@ +kuttl-test.yaml diff --git a/tests/e2e/examples/Makefile b/tests/e2e/examples/Makefile new file mode 100644 index 000000000..03f05afe9 --- /dev/null +++ b/tests/e2e/examples/Makefile @@ -0,0 +1,6 @@ +render-e2e-tests-examples: TEST_SUITE_NAME=examples +render-e2e-tests-examples: generate-kuttl-config + ./tests/e2e/examples/render.sh + +run-e2e-tests-examples: TEST_SUITE_NAME=examples +run-e2e-tests-examples: run-suite-tests diff --git a/tests/e2e/examples-agent-as-daemonset/.gitignore b/tests/e2e/examples/examples-agent-as-daemonset/.gitignore similarity index 100% rename from tests/e2e/examples-agent-as-daemonset/.gitignore rename to tests/e2e/examples/examples-agent-as-daemonset/.gitignore diff --git a/tests/e2e/examples-agent-as-daemonset/01-assert.yaml b/tests/e2e/examples/examples-agent-as-daemonset/01-assert.yaml similarity index 100% rename from tests/e2e/examples-agent-as-daemonset/01-assert.yaml rename to tests/e2e/examples/examples-agent-as-daemonset/01-assert.yaml diff --git a/tests/e2e/examples-business-application-injected-sidecar/.gitignore b/tests/e2e/examples/examples-business-application-injected-sidecar/.gitignore similarity index 100% rename from tests/e2e/examples-business-application-injected-sidecar/.gitignore rename to tests/e2e/examples/examples-business-application-injected-sidecar/.gitignore diff --git a/tests/e2e/examples-business-application-injected-sidecar/00-assert.yaml b/tests/e2e/examples/examples-business-application-injected-sidecar/00-assert.yaml similarity index 100% rename from tests/e2e/examples-business-application-injected-sidecar/00-assert.yaml rename to tests/e2e/examples/examples-business-application-injected-sidecar/00-assert.yaml diff --git a/tests/e2e/examples-business-application-injected-sidecar/livenessProbe.yaml b/tests/e2e/examples/examples-business-application-injected-sidecar/livenessProbe.yaml similarity index 100% rename from tests/e2e/examples-business-application-injected-sidecar/livenessProbe.yaml rename to tests/e2e/examples/examples-business-application-injected-sidecar/livenessProbe.yaml diff --git a/tests/e2e/examples-service-types/.gitignore b/tests/e2e/examples/examples-service-types/.gitignore similarity index 100% rename from tests/e2e/examples-service-types/.gitignore rename to tests/e2e/examples/examples-service-types/.gitignore diff --git a/tests/e2e/examples-service-types/02-assert.yaml b/tests/e2e/examples/examples-service-types/02-assert.yaml similarity index 100% rename from tests/e2e/examples-service-types/02-assert.yaml rename to tests/e2e/examples/examples-service-types/02-assert.yaml diff --git a/tests/e2e/examples-simple-prod-with-volumes/.gitignore b/tests/e2e/examples/examples-simple-prod-with-volumes/.gitignore similarity index 100% rename from tests/e2e/examples-simple-prod-with-volumes/.gitignore rename to tests/e2e/examples/examples-simple-prod-with-volumes/.gitignore diff --git a/tests/e2e/examples-simple-prod/.gitignore b/tests/e2e/examples/examples-simple-prod/.gitignore similarity index 100% rename from tests/e2e/examples-simple-prod/.gitignore rename to tests/e2e/examples/examples-simple-prod/.gitignore diff --git a/tests/e2e/examples-simplest/.gitignore b/tests/e2e/examples/examples-simplest/.gitignore similarity index 100% rename from tests/e2e/examples-simplest/.gitignore rename to tests/e2e/examples/examples-simplest/.gitignore diff --git a/tests/e2e/examples-with-badger-and-volume/.gitignore b/tests/e2e/examples/examples-with-badger-and-volume/.gitignore similarity index 100% rename from tests/e2e/examples-with-badger-and-volume/.gitignore rename to tests/e2e/examples/examples-with-badger-and-volume/.gitignore diff --git a/tests/e2e/examples-with-badger/.gitignore b/tests/e2e/examples/examples-with-badger/.gitignore similarity index 100% rename from tests/e2e/examples-with-badger/.gitignore rename to tests/e2e/examples/examples-with-badger/.gitignore diff --git a/tests/e2e/examples-with-cassandra/.gitignore b/tests/e2e/examples/examples-with-cassandra/.gitignore similarity index 100% rename from tests/e2e/examples-with-cassandra/.gitignore rename to tests/e2e/examples/examples-with-cassandra/.gitignore diff --git a/tests/e2e/examples-with-sampling/.gitignore b/tests/e2e/examples/examples-with-sampling/.gitignore similarity index 100% rename from tests/e2e/examples-with-sampling/.gitignore rename to tests/e2e/examples/examples-with-sampling/.gitignore diff --git a/tests/e2e/examples-with-sampling/03-assert.yaml b/tests/e2e/examples/examples-with-sampling/03-assert.yaml similarity index 100% rename from tests/e2e/examples-with-sampling/03-assert.yaml rename to tests/e2e/examples/examples-with-sampling/03-assert.yaml diff --git a/tests/e2e/examples/render.sh b/tests/e2e/examples/render.sh new file mode 100755 index 000000000..5b1a8ca94 --- /dev/null +++ b/tests/e2e/examples/render.sh @@ -0,0 +1,136 @@ +#!/bin/bash + +source $(dirname "$0")/../render-utils.sh + +cd $SUITE_DIR + +echo "Rendering templates for examples-agent-as-daemonset test" +cd examples-agent-as-daemonset +export JAEGER_NAME=agent-as-daemonset +export JAEGER_SERVICE=agent-as-daemonset +export JAEGER_OPERATION=smoketestoperation +$GOMPLATE -f $EXAMPLES_DIR/agent-as-daemonset.yaml -o ./00-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/allinone-jaeger-assert.yaml.template -o ./00-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test.yaml.template -o ./02-smoke-test.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test-assert.yaml.template -o ./02-assert.yaml + +cd .. + +echo "Rendering templates for examples-business-application-injected-sidecar test" +cd examples-business-application-injected-sidecar +export JAEGER_NAME=simplest +export JAEGER_SERVICE=simplest +export JAEGER_OPERATION=smoketestoperation +cat $EXAMPLES_DIR/business-application-injected-sidecar.yaml ./livenessProbe.yaml > ./00-install.yaml +$GOMPLATE -f $EXAMPLES_DIR/simplest.yaml -o./01-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/allinone-jaeger-assert.yaml.template -o./01-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test.yaml.template -o./02-smoke-test.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test-assert.yaml.template -o./02-assert.yaml + +cd .. + +echo "Rendering templates for examples-service-types test" +cd examples-service-types +export JAEGER_SERVICE=service-types +export JAEGER_OPERATION=smoketestoperation +export JAEGER_NAME=service-types +$GOMPLATE -f $EXAMPLES_DIR/service-types.yaml -o ./00-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/allinone-jaeger-assert.yaml.template -o ./00-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test.yaml.template -o ./01-smoke-test.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test-assert.yaml.template -o ./01-assert.yaml + +cd .. + +echo "Rendering templates for examples-simple-prod test" +cd examples-simple-prod +export JAEGER_SERVICE=simple-prod +export JAEGER_OPERATION=smoketestoperation +export JAEGER_NAME=simple-prod +$GOMPLATE -f $TEMPLATES_DIR/elasticsearch-install.yaml.template -o ./00-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/elasticsearch-assert.yaml.template -o ./00-assert.yaml +$GOMPLATE -f $EXAMPLES_DIR/simple-prod.yaml -o ./01-install.yaml +sed -i "s~server-urls: http://elasticsearch.default.svc:9200~server-urls: http://elasticsearch:9200~gi" ./01-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/production-jaeger-assert.yaml.template -o ./01-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test.yaml.template -o ./02-smoke-test.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test-assert.yaml.template -o ./02-assert.yaml + +cd .. + +echo "Rendering templates for examples-simple-prod-with-volumes test" +cd examples-simple-prod-with-volumes +export JAEGER_SERVICE=simple-prod-with-volumes +export JAEGER_OPERATION=smoketestoperation +export JAEGER_NAME=simple-prod +$GOMPLATE -f $TEMPLATES_DIR/elasticsearch-install.yaml.template -o ./00-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/elasticsearch-assert.yaml.template -o ./00-assert.yaml +$GOMPLATE -f $EXAMPLES_DIR/simple-prod-with-volumes.yaml -o ./01-install.yaml +sed -i "s~server-urls: http://elasticsearch.default.svc:9200~server-urls: http://elasticsearch:9200~gi" ./01-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/production-jaeger-assert.yaml.template -o ./01-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test.yaml.template -o ./02-smoke-test.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test-assert.yaml.template -o ./02-assert.yaml + +cd .. + +echo "Rendering templates for examples-simplest test" +cd examples-simplest +export JAEGER_SERVICE=smoketest +export JAEGER_OPERATION=smoketestoperation +export JAEGER_NAME=simplest +$GOMPLATE -f $EXAMPLES_DIR/simplest.yaml -o ./00-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/allinone-jaeger-assert.yaml.template -o ./00-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test.yaml.template -o ./01-smoke-test.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test-assert.yaml.template -o ./01-assert.yaml + +cd .. + +echo "Rendering templates for examples-with-badger test" +cd examples-with-badger +export JAEGER_SERVICE=with-badger +export JAEGER_OPERATION=smoketestoperation +export JAEGER_NAME=with-badger +$GOMPLATE -f $EXAMPLES_DIR/with-badger.yaml -o ./00-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/allinone-jaeger-assert.yaml.template -o ./00-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test.yaml.template -o ./01-smoke-test.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test-assert.yaml.template -o ./01-assert.yaml + +cd .. + + +echo "Rendering templates for examples-with-badger-and-volume test" +cd examples-with-badger-and-volume +export JAEGER_SERVICE=with-badger-and-volume +export JAEGER_OPERATION=smoketestoperation +export JAEGER_NAME=with-badger-and-volume +$GOMPLATE -f $EXAMPLES_DIR/with-badger-and-volume.yaml -o ./00-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/allinone-jaeger-assert.yaml.template -o ./00-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test.yaml.template -o ./01-smoke-test.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test-assert.yaml.template -o ./01-assert.yaml + +cd .. + +echo "Rendering templates for examples-with-cassandra test" +cd examples-with-cassandra +export JAEGER_SERVICE=with-cassandra +export JAEGER_OPERATION=smoketestoperation +export JAEGER_NAME=with-cassandra +$GOMPLATE -f $TEMPLATES_DIR/cassandra-install.yaml.template -o ./00-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/cassandra-assert.yaml.template -o ./00-assert.yaml +$GOMPLATE -f $EXAMPLES_DIR/with-cassandra.yaml -o ./01-install.yaml +sed -i "s~cassandra.default.svc~cassandra~gi" ./01-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/allinone-jaeger-assert.yaml.template -o ./01-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test.yaml.template -o ./02-smoke-test.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test-assert.yaml.template -o ./02-assert.yaml +cd .. + +echo "Rendering templates for examples-with-sampling test" +cd examples-with-sampling +export JAEGER_SERVICE=with-sampling +export JAEGER_OPERATION=smoketestoperation +export JAEGER_NAME=with-sampling +$GOMPLATE -f $TEMPLATES_DIR/elasticsearch-install.yaml.template -o ./00-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/elasticsearch-assert.yaml.template -o ./00-assert.yaml +$GOMPLATE -f $EXAMPLES_DIR/with-sampling.yaml -o ./01-install.yaml +sed -i "s~server-urls: http://elasticsearch.default.svc:9200~server-urls: http://elasticsearch:9200~gi" ./01-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/allinone-jaeger-assert.yaml.template -o ./01-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test.yaml.template -o ./02-smoke-test.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test-assert.yaml.template -o ./02-assert.yaml diff --git a/tests/e2e/generate/.gitignore b/tests/e2e/generate/.gitignore index 7c1bd2c28..e7b239632 100644 --- a/tests/e2e/generate/.gitignore +++ b/tests/e2e/generate/.gitignore @@ -1,2 +1 @@ -generated-manifest.yaml -jaeger-deployment.yaml +kuttl-test.yaml diff --git a/tests/e2e/generate/01-assert.yaml b/tests/e2e/generate/01-assert.yaml deleted file mode 100644 index bf5d8dc39..000000000 --- a/tests/e2e/generate/01-assert.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# Assert the spans are reported -apiVersion: batch/v1 -kind: Job -metadata: - name: report-span -status: - succeeded: 1 ---- -# Assert the span were received -apiVersion: batch/v1 -kind: Job -metadata: - name: query-span -status: - succeeded: 1 diff --git a/tests/e2e/generate/01-smoke-test.yaml b/tests/e2e/generate/01-smoke-test.yaml deleted file mode 100644 index 995b4afdd..000000000 --- a/tests/e2e/generate/01-smoke-test.yaml +++ /dev/null @@ -1,38 +0,0 @@ -# Report some spans to run a smoke test -apiVersion: batch/v1 -kind: Job -metadata: - name: report-span -spec: - template: - spec: - containers: - - name: asserts-container - image: local/asserts:e2e - command: ["./reporter"] - env: - - name: JAEGER_SERVICE_NAME - value: "my-test-service" - - name: OPERATION_NAME - value: "my-little-op" - - name: JAEGER_ENDPOINT - value: "http://my-jaeger-collector-headless:14268/api/traces" - - name: JAEGER_QUERY - value: "http://my-jaeger-query:16686/api/traces" - restartPolicy: OnFailure - backoffLimit: 10 ---- -# Check if the spans are available -apiVersion: batch/v1 -kind: Job -metadata: - name: query-span -spec: - template: - spec: - containers: - - name: asserts-container - image: local/asserts:e2e - command: ["./query", --service-name=my-test-service, "--query-host=my-jaeger-query:16686"] - restartPolicy: OnFailure - backoffLimit: 10 diff --git a/tests/e2e/generate/02-cleanup.yaml b/tests/e2e/generate/02-cleanup.yaml deleted file mode 100644 index a829e3516..000000000 --- a/tests/e2e/generate/02-cleanup.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - # Before executing the KUTTL tests, the Jaeger Operator is deployed in the - # observability namespace. During the deployment of the manifest in, - # this test, that deployment is modified For that reason, the test - # is not isolated. TODO: task #1575. To decrease the impact of #1579, the - # original configuration of the Jaeger Operator is applied here - - script: "kubectl apply -f ../../_build/manifests/01-jaeger-operator.yaml -n observability" diff --git a/tests/e2e/generate/Makefile b/tests/e2e/generate/Makefile new file mode 100644 index 000000000..14eeb0e64 --- /dev/null +++ b/tests/e2e/generate/Makefile @@ -0,0 +1,6 @@ +render-e2e-tests-generate: TEST_SUITE_NAME=generate +render-e2e-tests-generate: generate-kuttl-config + JAEGER_VERSION=${JAEGER_VERSION} ./tests/e2e/generate/render.sh + +run-e2e-tests-generate: TEST_SUITE_NAME=generate +run-e2e-tests-generate: run-suite-tests diff --git a/tests/e2e/generate/generate/.gitignore b/tests/e2e/generate/generate/.gitignore new file mode 100644 index 000000000..8b69f1b2c --- /dev/null +++ b/tests/e2e/generate/generate/.gitignore @@ -0,0 +1,4 @@ +generated-manifest.yaml +jaeger-deployment.yaml +01-smoke-test.yaml +01-assert.yaml diff --git a/tests/e2e/generate/00-assert.yaml b/tests/e2e/generate/generate/00-assert.yaml similarity index 100% rename from tests/e2e/generate/00-assert.yaml rename to tests/e2e/generate/generate/00-assert.yaml diff --git a/tests/e2e/generate/00-generate.yaml b/tests/e2e/generate/generate/00-generate.yaml similarity index 62% rename from tests/e2e/generate/00-generate.yaml rename to tests/e2e/generate/generate/00-generate.yaml index 1379fc97b..1bf078bdb 100644 --- a/tests/e2e/generate/00-generate.yaml +++ b/tests/e2e/generate/generate/00-generate.yaml @@ -2,7 +2,7 @@ apiVersion: kuttl.dev/v1beta1 kind: TestStep commands: # Generate the manifest from the CRDs - - script: "../../../bin/jaeger-operator generate --cr jaeger-deployment.yaml --output generated-manifest.yaml" + - script: "../../../../bin/jaeger-operator generate --cr jaeger-deployment.yaml --output generated-manifest.yaml" # Deploy the manifest - command: "kubectl apply -f generated-manifest.yaml" namespaced: true diff --git a/tests/e2e/generate/jaeger-template.yaml.template b/tests/e2e/generate/generate/jaeger-template.yaml.template similarity index 100% rename from tests/e2e/generate/jaeger-template.yaml.template rename to tests/e2e/generate/generate/jaeger-template.yaml.template diff --git a/tests/e2e/generate/render.sh b/tests/e2e/generate/render.sh new file mode 100755 index 000000000..26681dc12 --- /dev/null +++ b/tests/e2e/generate/render.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +source $(dirname "$0")/../render-utils.sh + +cd $SUITE_DIR + +echo "Rendering templates for generate test" +cd generate +# JAEGER_VERSION environment variable is set before this script is called +export JAEGER_NAME=my-jaeger +export JAEGER_SERVICE=test-service +export JAEGER_OPERATION=smoketestoperation +$GOMPLATE -f ./jaeger-template.yaml.template -o ./jaeger-deployment.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test.yaml.template -o ./01-smoke-test.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test-assert.yaml.template -o ./01-assert.yaml diff --git a/tests/e2e/istio/.gitignore b/tests/e2e/istio/.gitignore index 6a0d068f9..e7b239632 100644 --- a/tests/e2e/istio/.gitignore +++ b/tests/e2e/istio/.gitignore @@ -1 +1 @@ -03-install.yaml +kuttl-test.yaml diff --git a/tests/e2e/istio/04-assert.yaml b/tests/e2e/istio/04-assert.yaml deleted file mode 100644 index f224ec65f..000000000 --- a/tests/e2e/istio/04-assert.yaml +++ /dev/null @@ -1,7 +0,0 @@ -# Assert the find-service job was run successfully -apiVersion: batch/v1 -kind: Job -metadata: - name: find-service -status: - succeeded: 1 diff --git a/tests/e2e/istio/04-smoke.yaml b/tests/e2e/istio/04-smoke.yaml deleted file mode 100644 index dcb57f88a..000000000 --- a/tests/e2e/istio/04-smoke.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# Check that some data was generated properly -apiVersion: batch/v1 -kind: Job -metadata: - name: find-service -spec: - template: - metadata: - annotations: - sidecar.istio.io/inject: "false" - spec: - containers: - - name: asserts-container - image: local/asserts:e2e - command: ["./query"] - env: - - name: SERVICE_NAME - value: "order" - - name: QUERY_HOST - value: "simplest-query:16686" - restartPolicy: OnFailure - backoffLimit: 10 diff --git a/tests/e2e/istio/Makefile b/tests/e2e/istio/Makefile new file mode 100644 index 000000000..94fe9858d --- /dev/null +++ b/tests/e2e/istio/Makefile @@ -0,0 +1,6 @@ +render-e2e-tests-istio: TEST_SUITE_NAME=istio +render-e2e-tests-istio: generate-kuttl-config + ./tests/e2e/istio/render.sh + +run-e2e-tests-istio: TEST_SUITE_NAME=istio +run-e2e-tests-istio: run-suite-tests diff --git a/tests/e2e/istio/istio/.gitignore b/tests/e2e/istio/istio/.gitignore new file mode 100644 index 000000000..7e6398518 --- /dev/null +++ b/tests/e2e/istio/istio/.gitignore @@ -0,0 +1,3 @@ +03-install.yaml +04-assert.yaml +04-smoke.yaml diff --git a/tests/e2e/istio/00-assert.yaml b/tests/e2e/istio/istio/00-assert.yaml similarity index 100% rename from tests/e2e/istio/00-assert.yaml rename to tests/e2e/istio/istio/00-assert.yaml diff --git a/tests/e2e/istio/00-install.yaml b/tests/e2e/istio/istio/00-install.yaml similarity index 59% rename from tests/e2e/istio/00-install.yaml rename to tests/e2e/istio/istio/00-install.yaml index 8aba0577e..12b6a41a0 100644 --- a/tests/e2e/istio/00-install.yaml +++ b/tests/e2e/istio/istio/00-install.yaml @@ -2,4 +2,4 @@ apiVersion: kuttl.dev/v1beta1 kind: TestStep commands: - - script: "pwd && cd ../../.. && make istio" + - script: "cd ../../../.. && make istio" diff --git a/tests/e2e/istio/01-assert.yaml b/tests/e2e/istio/istio/01-assert.yaml similarity index 100% rename from tests/e2e/istio/01-assert.yaml rename to tests/e2e/istio/istio/01-assert.yaml diff --git a/tests/e2e/istio/01-install.yaml b/tests/e2e/istio/istio/01-install.yaml similarity index 100% rename from tests/e2e/istio/01-install.yaml rename to tests/e2e/istio/istio/01-install.yaml diff --git a/tests/e2e/istio/02-assert.yaml b/tests/e2e/istio/istio/02-assert.yaml similarity index 100% rename from tests/e2e/istio/02-assert.yaml rename to tests/e2e/istio/istio/02-assert.yaml diff --git a/tests/e2e/istio/02-install.yaml b/tests/e2e/istio/istio/02-install.yaml similarity index 100% rename from tests/e2e/istio/02-install.yaml rename to tests/e2e/istio/istio/02-install.yaml diff --git a/tests/e2e/istio/03-assert.yaml b/tests/e2e/istio/istio/03-assert.yaml similarity index 100% rename from tests/e2e/istio/03-assert.yaml rename to tests/e2e/istio/istio/03-assert.yaml diff --git a/tests/e2e/istio/livelinessprobe.template b/tests/e2e/istio/istio/livelinessprobe.template similarity index 100% rename from tests/e2e/istio/livelinessprobe.template rename to tests/e2e/istio/istio/livelinessprobe.template diff --git a/tests/e2e/istio/render.sh b/tests/e2e/istio/render.sh new file mode 100755 index 000000000..35b7dee85 --- /dev/null +++ b/tests/e2e/istio/render.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +source $(dirname "$0")/../render-utils.sh + +cd $SUITE_DIR + +echo "Rendering templates for istio test" +cd istio +export JAEGER_NAME=simplest +export JAEGER_SERVICE=order +cat $EXAMPLES_DIR/business-application-injected-sidecar.yaml ./livelinessprobe.template > ./03-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/find-service.yaml.template -o ./04-smoke.yaml +$GOMPLATE -f $TEMPLATES_DIR/assert-find-service.yaml.template -o ./04-assert.yaml diff --git a/tests/e2e/outside-cluster/.gitignore b/tests/e2e/outside-cluster/.gitignore new file mode 100644 index 000000000..e7b239632 --- /dev/null +++ b/tests/e2e/outside-cluster/.gitignore @@ -0,0 +1 @@ +kuttl-test.yaml diff --git a/tests/e2e/outside-cluster/Makefile b/tests/e2e/outside-cluster/Makefile new file mode 100644 index 000000000..861defdd4 --- /dev/null +++ b/tests/e2e/outside-cluster/Makefile @@ -0,0 +1,5 @@ +render-e2e-tests-outside-cluster: TEST_SUITE_NAME=outside-cluster +render-e2e-tests-outside-cluster: generate-kuttl-config + +run-e2e-tests-outside-cluster: TEST_SUITE_NAME=outside-cluster +run-e2e-tests-outside-cluster: run-suite-tests diff --git a/tests/e2e/outside-cluster/00-assert.yaml b/tests/e2e/outside-cluster/outside-cluster/00-assert.yaml similarity index 100% rename from tests/e2e/outside-cluster/00-assert.yaml rename to tests/e2e/outside-cluster/outside-cluster/00-assert.yaml diff --git a/tests/e2e/outside-cluster/00-install.yaml b/tests/e2e/outside-cluster/outside-cluster/00-install.yaml similarity index 100% rename from tests/e2e/outside-cluster/00-install.yaml rename to tests/e2e/outside-cluster/outside-cluster/00-install.yaml diff --git a/tests/e2e/outside-cluster/01-check-collector.yaml b/tests/e2e/outside-cluster/outside-cluster/01-check-collector.yaml similarity index 50% rename from tests/e2e/outside-cluster/01-check-collector.yaml rename to tests/e2e/outside-cluster/outside-cluster/01-check-collector.yaml index 684a4bcc2..6e4e39c94 100644 --- a/tests/e2e/outside-cluster/01-check-collector.yaml +++ b/tests/e2e/outside-cluster/outside-cluster/01-check-collector.yaml @@ -1,5 +1,5 @@ apiVersion: kuttl.dev/v1beta1 kind: TestStep commands: - - script: "JAEGER_SERVICE_NAME=my-test-service OPERATION_NAME=my-little-op JAEGER_ENDPOINT=http://localhost/collector/api/traces go run ../../assert-jobs/reporter/main.go --verbose" - - script: "go run ../../assert-jobs/query/main.go --service-name my-test-service --query-host localhost/query" + - script: "JAEGER_SERVICE_NAME=my-test-service OPERATION_NAME=my-little-op JAEGER_ENDPOINT=http://localhost/collector/api/traces go run ../../../assert-jobs/reporter/main.go --verbose" + - script: "go run ../../../assert-jobs/query/main.go --service-name my-test-service --query-host http://localhost/query" diff --git a/tests/e2e/render-utils.sh b/tests/e2e/render-utils.sh new file mode 100644 index 000000000..93516aefd --- /dev/null +++ b/tests/e2e/render-utils.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# +# Utils for the render.sh scripts. +# +if [[ "$(basename -- "$0")" == "render-utils.sh" ]]; then + echo "Don't run $0, source it" >&2 + exit 1 +fi + +# Enable verbosity +if [ "$VERBOSE" = true ]; then + set -o xtrace +fi + +# Check the dependencies are there +export GOMPLATE=$(which gomplate) +if [ -z "$GOMPLATE" ]; then + "gomplate is not installed. Please, install it" + exit 1 +fi + +export ROOT_DIR=../../../.. +export TEST_DIR=../../.. +export TEMPLATES_DIR=$TEST_DIR/templates +export EXAMPLES_DIR=$ROOT_DIR/examples +export SUITE_DIR=$(dirname "$0") diff --git a/tests/e2e/sidecar-namespace/02-assert.yaml b/tests/e2e/sidecar-namespace/02-assert.yaml deleted file mode 100644 index 3843ea787..000000000 --- a/tests/e2e/sidecar-namespace/02-assert.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: find-service-ns -status: - succeeded: 1 diff --git a/tests/e2e/sidecar-namespace/02-find-service.yaml b/tests/e2e/sidecar-namespace/02-find-service.yaml deleted file mode 100644 index 68c65e877..000000000 --- a/tests/e2e/sidecar-namespace/02-find-service.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: find-service-ns -spec: - template: - spec: - containers: - - name: asserts-container - image: local/asserts:e2e - command: ["./query"] - env: - - name: SERVICE_NAME - value: "order" - - name: QUERY_HOST - value: "agent-as-sidecar-query:16686" - restartPolicy: Never - backoffLimit: 1 diff --git a/tests/e2e/sidecar-namespace/05-assert.yaml b/tests/e2e/sidecar-namespace/05-assert.yaml deleted file mode 100644 index 86ef54943..000000000 --- a/tests/e2e/sidecar-namespace/05-assert.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: find-service2-ns -status: - succeeded: 1 diff --git a/tests/e2e/sidecar-namespace/05-find-service-other-instance.yaml b/tests/e2e/sidecar-namespace/05-find-service-other-instance.yaml deleted file mode 100644 index f305ce6b0..000000000 --- a/tests/e2e/sidecar-namespace/05-find-service-other-instance.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: find-service2-ns -spec: - template: - spec: - containers: - - name: asserts-container - image: local/asserts:e2e - command: ["./query"] - env: - - name: SERVICE_NAME - value: "order" - - name: QUERY_HOST - value: "agent-as-sidecar2-query:16686" - restartPolicy: Never - backoffLimit: 1 diff --git a/tests/e2e/sidecar/02-assert.yaml b/tests/e2e/sidecar/02-assert.yaml deleted file mode 100644 index d2c9366c5..000000000 --- a/tests/e2e/sidecar/02-assert.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: find-service -status: - succeeded: 1 diff --git a/tests/e2e/sidecar/05-assert.yaml b/tests/e2e/sidecar/05-assert.yaml deleted file mode 100644 index c28a89fcb..000000000 --- a/tests/e2e/sidecar/05-assert.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: find-service2 -status: - succeeded: 1 diff --git a/tests/e2e/sidecard/.gitignore b/tests/e2e/sidecard/.gitignore new file mode 100644 index 000000000..e7b239632 --- /dev/null +++ b/tests/e2e/sidecard/.gitignore @@ -0,0 +1 @@ +kuttl-test.yaml diff --git a/tests/e2e/sidecard/Makefile b/tests/e2e/sidecard/Makefile new file mode 100644 index 000000000..59e5d7129 --- /dev/null +++ b/tests/e2e/sidecard/Makefile @@ -0,0 +1,6 @@ +render-e2e-tests-sidecard: TEST_SUITE_NAME=sidecard +render-e2e-tests-sidecard: generate-kuttl-config + ./tests/e2e/sidecard/render.sh + +run-e2e-tests-sidecard: TEST_SUITE_NAME=sidecard +run-e2e-tests-sidecard: run-suite-tests diff --git a/tests/e2e/sidecard/render.sh b/tests/e2e/sidecard/render.sh new file mode 100755 index 000000000..5cdebcaf2 --- /dev/null +++ b/tests/e2e/sidecard/render.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +source $(dirname "$0")/../render-utils.sh + +cd $SUITE_DIR + +echo "Rendering templates for sidecar-agent test" +cd sidecar-agent +export JAEGER_NAME=agent-as-sidecar +export JAEGER_SERVICE=order +JOB_NUMBER=1 $GOMPLATE -f $TEMPLATES_DIR/find-service.yaml.template -o ./02-find-service.yaml +JOB_NUMBER=1 $GOMPLATE -f $TEMPLATES_DIR/assert-find-service.yaml.template -o ./02-assert.yaml +export JAEGER_NAME=agent-as-sidecar2 +JOB_NUMBER=2 $GOMPLATE -f $TEMPLATES_DIR/find-service.yaml.template -o ./05-find-service-other-instance.yaml +JOB_NUMBER=2 $GOMPLATE -f $TEMPLATES_DIR/assert-find-service.yaml.template -o ./05-assert.yaml + +cd .. + +echo "Rendering templates for sidecar-namespace test" +cd sidecar-namespace +export JAEGER_NAME=agent-as-sidecar +export JAEGER_SERVICE=order +JOB_NUMBER=1 $GOMPLATE -f $TEMPLATES_DIR/find-service.yaml.template -o ./02-find-service.yaml +JOB_NUMBER=1 $GOMPLATE -f $TEMPLATES_DIR/assert-find-service.yaml.template -o ./02-assert.yaml +export JAEGER_NAME=agent-as-sidecar2 +JOB_NUMBER=2 $GOMPLATE -f $TEMPLATES_DIR/find-service.yaml.template -o ./05-find-service-other-instance.yaml +JOB_NUMBER=2 $GOMPLATE -f $TEMPLATES_DIR/assert-find-service.yaml.template -o ./05-assert.yaml diff --git a/tests/e2e/sidecard/sidecar-agent/.gitignore b/tests/e2e/sidecard/sidecar-agent/.gitignore new file mode 100644 index 000000000..941b2bb6d --- /dev/null +++ b/tests/e2e/sidecard/sidecar-agent/.gitignore @@ -0,0 +1,4 @@ +02-find-service.yaml +02-assert.yaml +05-find-service-other-instance.yaml +05-assert.yaml diff --git a/tests/e2e/sidecar-namespace/00-assert.yaml b/tests/e2e/sidecard/sidecar-agent/00-assert.yaml similarity index 100% rename from tests/e2e/sidecar-namespace/00-assert.yaml rename to tests/e2e/sidecard/sidecar-agent/00-assert.yaml diff --git a/tests/e2e/sidecar-deployment/00-install.yaml b/tests/e2e/sidecard/sidecar-agent/00-install.yaml similarity index 100% rename from tests/e2e/sidecar-deployment/00-install.yaml rename to tests/e2e/sidecard/sidecar-agent/00-install.yaml diff --git a/tests/e2e/sidecar-deployment/01-assert.yaml b/tests/e2e/sidecard/sidecar-agent/01-assert.yaml similarity index 100% rename from tests/e2e/sidecar-deployment/01-assert.yaml rename to tests/e2e/sidecard/sidecar-agent/01-assert.yaml diff --git a/tests/e2e/sidecar-deployment/01-deploy-vertx.yaml b/tests/e2e/sidecard/sidecar-agent/01-deploy-vertx.yaml similarity index 100% rename from tests/e2e/sidecar-deployment/01-deploy-vertx.yaml rename to tests/e2e/sidecard/sidecar-agent/01-deploy-vertx.yaml diff --git a/tests/e2e/sidecar-namespace/03-assert.yaml b/tests/e2e/sidecard/sidecar-agent/03-assert.yaml similarity index 100% rename from tests/e2e/sidecar-namespace/03-assert.yaml rename to tests/e2e/sidecard/sidecar-agent/03-assert.yaml diff --git a/tests/e2e/sidecar-namespace/03-other-instance.yaml b/tests/e2e/sidecard/sidecar-agent/03-other-instance.yaml similarity index 100% rename from tests/e2e/sidecar-namespace/03-other-instance.yaml rename to tests/e2e/sidecard/sidecar-agent/03-other-instance.yaml diff --git a/tests/e2e/sidecar-namespace/04-delete-first-instance.yaml b/tests/e2e/sidecard/sidecar-agent/04-delete-first-instance.yaml similarity index 100% rename from tests/e2e/sidecar-namespace/04-delete-first-instance.yaml rename to tests/e2e/sidecard/sidecar-agent/04-delete-first-instance.yaml diff --git a/tests/e2e/sidecar-namespace/04-errors.yaml b/tests/e2e/sidecard/sidecar-agent/04-errors.yaml similarity index 100% rename from tests/e2e/sidecar-namespace/04-errors.yaml rename to tests/e2e/sidecard/sidecar-agent/04-errors.yaml diff --git a/tests/e2e/sidecar/00-install.yaml b/tests/e2e/sidecard/sidecar-deployment/00-install.yaml similarity index 100% rename from tests/e2e/sidecar/00-install.yaml rename to tests/e2e/sidecard/sidecar-deployment/00-install.yaml diff --git a/tests/e2e/sidecar-namespace/01-assert.yaml b/tests/e2e/sidecard/sidecar-deployment/01-assert.yaml similarity index 100% rename from tests/e2e/sidecar-namespace/01-assert.yaml rename to tests/e2e/sidecard/sidecar-deployment/01-assert.yaml diff --git a/tests/e2e/sidecar/01-deploy-vertx.yaml b/tests/e2e/sidecard/sidecar-deployment/01-deploy-vertx.yaml similarity index 100% rename from tests/e2e/sidecar/01-deploy-vertx.yaml rename to tests/e2e/sidecard/sidecar-deployment/01-deploy-vertx.yaml diff --git a/tests/e2e/sidecar-deployment/02-assert.yaml b/tests/e2e/sidecard/sidecar-deployment/02-assert.yaml similarity index 100% rename from tests/e2e/sidecar-deployment/02-assert.yaml rename to tests/e2e/sidecard/sidecar-deployment/02-assert.yaml diff --git a/tests/e2e/sidecar-deployment/02-change-annotation.yaml b/tests/e2e/sidecard/sidecar-deployment/02-change-annotation.yaml similarity index 100% rename from tests/e2e/sidecar-deployment/02-change-annotation.yaml rename to tests/e2e/sidecard/sidecar-deployment/02-change-annotation.yaml diff --git a/tests/e2e/sidecar-deployment/02-errors.yaml b/tests/e2e/sidecard/sidecar-deployment/02-errors.yaml similarity index 100% rename from tests/e2e/sidecar-deployment/02-errors.yaml rename to tests/e2e/sidecard/sidecar-deployment/02-errors.yaml diff --git a/tests/e2e/sidecard/sidecar-namespace/.gitignore b/tests/e2e/sidecard/sidecar-namespace/.gitignore new file mode 100644 index 000000000..941b2bb6d --- /dev/null +++ b/tests/e2e/sidecard/sidecar-namespace/.gitignore @@ -0,0 +1,4 @@ +02-find-service.yaml +02-assert.yaml +05-find-service-other-instance.yaml +05-assert.yaml diff --git a/tests/e2e/sidecar/00-assert.yaml b/tests/e2e/sidecard/sidecar-namespace/00-assert.yaml similarity index 100% rename from tests/e2e/sidecar/00-assert.yaml rename to tests/e2e/sidecard/sidecar-namespace/00-assert.yaml diff --git a/tests/e2e/sidecar-namespace/00-install.yaml b/tests/e2e/sidecard/sidecar-namespace/00-install.yaml similarity index 100% rename from tests/e2e/sidecar-namespace/00-install.yaml rename to tests/e2e/sidecard/sidecar-namespace/00-install.yaml diff --git a/tests/e2e/sidecar/01-assert.yaml b/tests/e2e/sidecard/sidecar-namespace/01-assert.yaml similarity index 100% rename from tests/e2e/sidecar/01-assert.yaml rename to tests/e2e/sidecard/sidecar-namespace/01-assert.yaml diff --git a/tests/e2e/sidecar-namespace/01-deploy-vertx.yaml b/tests/e2e/sidecard/sidecar-namespace/01-deploy-vertx.yaml similarity index 100% rename from tests/e2e/sidecar-namespace/01-deploy-vertx.yaml rename to tests/e2e/sidecard/sidecar-namespace/01-deploy-vertx.yaml diff --git a/tests/e2e/sidecar/03-assert.yaml b/tests/e2e/sidecard/sidecar-namespace/03-assert.yaml similarity index 100% rename from tests/e2e/sidecar/03-assert.yaml rename to tests/e2e/sidecard/sidecar-namespace/03-assert.yaml diff --git a/tests/e2e/sidecar/03-other-instance.yaml b/tests/e2e/sidecard/sidecar-namespace/03-other-instance.yaml similarity index 100% rename from tests/e2e/sidecar/03-other-instance.yaml rename to tests/e2e/sidecard/sidecar-namespace/03-other-instance.yaml diff --git a/tests/e2e/sidecar/04-delete-first-instance.yaml b/tests/e2e/sidecard/sidecar-namespace/04-delete-first-instance.yaml similarity index 100% rename from tests/e2e/sidecar/04-delete-first-instance.yaml rename to tests/e2e/sidecard/sidecar-namespace/04-delete-first-instance.yaml diff --git a/tests/e2e/sidecar/04-errors.yaml b/tests/e2e/sidecard/sidecar-namespace/04-errors.yaml similarity index 100% rename from tests/e2e/sidecar/04-errors.yaml rename to tests/e2e/sidecard/sidecar-namespace/04-errors.yaml diff --git a/tests/e2e/sidecar-namespace/annotate-ns.sh b/tests/e2e/sidecard/sidecar-namespace/annotate-ns.sh similarity index 100% rename from tests/e2e/sidecar-namespace/annotate-ns.sh rename to tests/e2e/sidecard/sidecar-namespace/annotate-ns.sh diff --git a/tests/e2e/smoke/.gitignore b/tests/e2e/smoke/.gitignore new file mode 100644 index 000000000..e7b239632 --- /dev/null +++ b/tests/e2e/smoke/.gitignore @@ -0,0 +1 @@ +kuttl-test.yaml diff --git a/tests/e2e/smoke/Makefile b/tests/e2e/smoke/Makefile new file mode 100644 index 000000000..cb0e7e5d4 --- /dev/null +++ b/tests/e2e/smoke/Makefile @@ -0,0 +1,5 @@ +render-e2e-tests-smoke: TEST_SUITE_NAME=smoke +render-e2e-tests-smoke: generate-kuttl-config + +run-e2e-tests-smoke: TEST_SUITE_NAME=smoke +run-e2e-tests-smoke: run-suite-tests diff --git a/tests/e2e/simplest/00-install.yaml b/tests/e2e/smoke/simplest/00-install.yaml similarity index 100% rename from tests/e2e/simplest/00-install.yaml rename to tests/e2e/smoke/simplest/00-install.yaml diff --git a/tests/e2e/simplest/01-assert.yaml b/tests/e2e/smoke/simplest/01-assert.yaml similarity index 100% rename from tests/e2e/simplest/01-assert.yaml rename to tests/e2e/smoke/simplest/01-assert.yaml diff --git a/tests/e2e/streaming-simple/00-install.yaml b/tests/e2e/streaming-simple/00-install.yaml deleted file mode 100644 index f7a039833..000000000 --- a/tests/e2e/streaming-simple/00-install.yaml +++ /dev/null @@ -1,6 +0,0 @@ -# Start Kafka -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - script: "cd ../../.. && KAFKA_NAMESPACE=$NAMESPACE make undeploy-kafka" - - script: "cd ../../.. && KAFKA_NAMESPACE=$NAMESPACE make kafka" diff --git a/tests/e2e/streaming-simple/01-install.yaml b/tests/e2e/streaming-simple/01-install.yaml deleted file mode 100644 index e88c2d00b..000000000 --- a/tests/e2e/streaming-simple/01-install.yaml +++ /dev/null @@ -1,72 +0,0 @@ -# Create create the StatefulSet for the ElasticSearch database -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: elasticsearch - - labels: - app: jaeger - jaeger-infra: elasticsearch-statefulset -spec: - selector: - matchLabels: - app: jaeger-elasticsearch - serviceName: elasticsearch - replicas: 1 - template: - metadata: - labels: - app: jaeger-elasticsearch - jaeger-infra: elasticsearch-replica - spec: - containers: - - name: elasticsearch - image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.8.6 - imagePullPolicy: Always - env: - - name: "http.host" - value: "0.0.0.0" - - name: "transport.host" - value: "127.0.0.1" - - name: "cluster.routing.allocation.disk.threshold_enabled" - value: "false" - ports: - - name: elasticsearch - containerPort: 9200 - - name: transport - containerPort: 9300 - volumeMounts: - - name: data - mountPath: /usr/share/elasticsearch/data - readinessProbe: - httpGet: - path: / - port: 9200 - initialDelaySeconds: 5 - periodSeconds: 5 - timeoutSeconds: 4 - securityContext: - capabilities: - add: ["SYS_CHROOT"] - volumes: - - name: data - emptyDir: {} ---- -# Deploy the ElasticSearch service -apiVersion: v1 -kind: Service -metadata: - name: elasticsearch - - labels: - app: jaeger - jaeger-infra: elasticsearch-service -spec: - clusterIP: None - selector: - app: jaeger-elasticsearch - ports: - - port: 9200 - name: elasticsearch - - port: 9300 - name: transport diff --git a/tests/e2e/streaming-simple/04-assert.yaml b/tests/e2e/streaming-simple/04-assert.yaml deleted file mode 100644 index 35f4124b9..000000000 --- a/tests/e2e/streaming-simple/04-assert.yaml +++ /dev/null @@ -1,7 +0,0 @@ -# Ensure the entity operator is up and running -apiVersion: apps/v1 -kind: Deployment -metadata: - name: my-cluster-entity-operator -status: - readyReplicas: 1 diff --git a/tests/e2e/streaming-with-autoprovisioning/00-install.yaml b/tests/e2e/streaming-with-autoprovisioning/00-install.yaml deleted file mode 100644 index c837a68f2..000000000 --- a/tests/e2e/streaming-with-autoprovisioning/00-install.yaml +++ /dev/null @@ -1,6 +0,0 @@ -# Start Kafka -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - script: "cd ../../.. && KAFKA_NAMESPACE=$NAMESPACE make undeploy-kafka-operator" - - script: "cd ../../.. && KAFKA_NAMESPACE=$NAMESPACE make deploy-kafka-operator" diff --git a/tests/e2e/streaming-with-autoprovisioning/01-install.yaml b/tests/e2e/streaming-with-autoprovisioning/01-install.yaml deleted file mode 100644 index e88c2d00b..000000000 --- a/tests/e2e/streaming-with-autoprovisioning/01-install.yaml +++ /dev/null @@ -1,72 +0,0 @@ -# Create create the StatefulSet for the ElasticSearch database -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: elasticsearch - - labels: - app: jaeger - jaeger-infra: elasticsearch-statefulset -spec: - selector: - matchLabels: - app: jaeger-elasticsearch - serviceName: elasticsearch - replicas: 1 - template: - metadata: - labels: - app: jaeger-elasticsearch - jaeger-infra: elasticsearch-replica - spec: - containers: - - name: elasticsearch - image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.8.6 - imagePullPolicy: Always - env: - - name: "http.host" - value: "0.0.0.0" - - name: "transport.host" - value: "127.0.0.1" - - name: "cluster.routing.allocation.disk.threshold_enabled" - value: "false" - ports: - - name: elasticsearch - containerPort: 9200 - - name: transport - containerPort: 9300 - volumeMounts: - - name: data - mountPath: /usr/share/elasticsearch/data - readinessProbe: - httpGet: - path: / - port: 9200 - initialDelaySeconds: 5 - periodSeconds: 5 - timeoutSeconds: 4 - securityContext: - capabilities: - add: ["SYS_CHROOT"] - volumes: - - name: data - emptyDir: {} ---- -# Deploy the ElasticSearch service -apiVersion: v1 -kind: Service -metadata: - name: elasticsearch - - labels: - app: jaeger - jaeger-infra: elasticsearch-service -spec: - clusterIP: None - selector: - app: jaeger-elasticsearch - ports: - - port: 9200 - name: elasticsearch - - port: 9300 - name: transport diff --git a/tests/e2e/streaming-with-autoprovisioning/05-assert.yaml b/tests/e2e/streaming-with-autoprovisioning/05-assert.yaml deleted file mode 100644 index 9110f0ed9..000000000 --- a/tests/e2e/streaming-with-autoprovisioning/05-assert.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# Assert the spans are reported -apiVersion: batch/v1 -kind: Job -metadata: - name: report-span -status: - succeeded: 1 ---- -# Assert the spans can be queried -apiVersion: batch/v1 -kind: Job -metadata: - name: check-span -status: - succeeded: 1 diff --git a/tests/e2e/streaming-with-tls/00-install.yaml b/tests/e2e/streaming-with-tls/00-install.yaml deleted file mode 100644 index f7a039833..000000000 --- a/tests/e2e/streaming-with-tls/00-install.yaml +++ /dev/null @@ -1,6 +0,0 @@ -# Start Kafka -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - script: "cd ../../.. && KAFKA_NAMESPACE=$NAMESPACE make undeploy-kafka" - - script: "cd ../../.. && KAFKA_NAMESPACE=$NAMESPACE make kafka" diff --git a/tests/e2e/streaming/.gitignore b/tests/e2e/streaming/.gitignore new file mode 100644 index 000000000..e7b239632 --- /dev/null +++ b/tests/e2e/streaming/.gitignore @@ -0,0 +1 @@ +kuttl-test.yaml diff --git a/tests/e2e/streaming/Makefile b/tests/e2e/streaming/Makefile new file mode 100644 index 000000000..2a6497050 --- /dev/null +++ b/tests/e2e/streaming/Makefile @@ -0,0 +1,6 @@ +render-e2e-tests-streaming: TEST_SUITE_NAME=streaming +render-e2e-tests-streaming: generate-kuttl-config + ./tests/e2e/streaming/render.sh + +run-e2e-tests-streaming: TEST_SUITE_NAME=streaming +run-e2e-tests-streaming: run-suite-tests diff --git a/tests/e2e/streaming/render.sh b/tests/e2e/streaming/render.sh new file mode 100755 index 000000000..cdbbc3ab4 --- /dev/null +++ b/tests/e2e/streaming/render.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +source $(dirname "$0")/../render-utils.sh + +cd $SUITE_DIR + +echo "Rendering templates for streaming-simple test" +cd streaming-simple +export CLUSTER_NAME=my-cluster +export REPLICAS=1 +export JAEGER_SERVICE=simple-streaming +export JAEGER_OPERATION=smoketestoperation +export JAEGER_NAME=simple-streaming +$GOMPLATE -f $TEMPLATES_DIR/elasticsearch-install.yaml.template -o ./01-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/elasticsearch-assert.yaml.template -o ./01-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/assert-kafka-cluster.yaml.template -o ./02-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/assert-zookeeper-cluster.yaml.template -o ./03-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/assert-entity-operator.yaml.template -o ./04-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test.yaml.template -o ./06-smoke-test.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test-assert.yaml.template -o ./06-assert.yaml + +cd .. + +echo "Rendering templates for streaming-with-tls test" +cd streaming-with-tls +export JAEGER_SERVICE=streaming-with-tls +export JAEGER_NAME=tls-streaming +$GOMPLATE -f $TEMPLATES_DIR/elasticsearch-install.yaml.template -o ./01-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/elasticsearch-assert.yaml.template -o ./01-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/assert-kafka-cluster.yaml.template -o ./02-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/assert-zookeeper-cluster.yaml.template -o ./03-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/assert-entity-operator.yaml.template -o ./04-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test.yaml.template -o ./07-smoke-test.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test-assert.yaml.template -o ./07-assert.yaml + +cd .. + +echo "Rendering templates for streaming-with-autoprovisioning test" +cd streaming-with-autoprovisioning +export CLUSTER_NAME=auto-provisioned +export REPLICAS=3 +export JAEGER_SERVICE=streaming-with-autoprovisioning +export JAEGER_NAME=auto-provisioned +$GOMPLATE -f $TEMPLATES_DIR/elasticsearch-install.yaml.template -o ./01-install.yaml +$GOMPLATE -f $TEMPLATES_DIR/elasticsearch-assert.yaml.template -o ./01-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/assert-zookeeper-cluster.yaml.template -o ./02-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/assert-kafka-cluster.yaml.template -o ./03-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/assert-entity-operator.yaml.template -o ./04-assert.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test.yaml.template -o ./05-smoke-test.yaml +$GOMPLATE -f $TEMPLATES_DIR/smoke-test-assert.yaml.template -o ./05-assert.yaml diff --git a/tests/e2e/streaming-simple/.gitignore b/tests/e2e/streaming/streaming-simple/.gitignore similarity index 100% rename from tests/e2e/streaming-simple/.gitignore rename to tests/e2e/streaming/streaming-simple/.gitignore diff --git a/tests/e2e/streaming/streaming-simple/00-install.yaml b/tests/e2e/streaming/streaming-simple/00-install.yaml new file mode 100644 index 000000000..1a36dc130 --- /dev/null +++ b/tests/e2e/streaming/streaming-simple/00-install.yaml @@ -0,0 +1,6 @@ +# Start Kafka +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: "cd ../../../.. && KAFKA_NAMESPACE=$NAMESPACE make undeploy-kafka" + - script: "cd ../../../.. && KAFKA_NAMESPACE=$NAMESPACE make kafka" diff --git a/tests/e2e/streaming-simple/05-assert.yaml b/tests/e2e/streaming/streaming-simple/05-assert.yaml similarity index 100% rename from tests/e2e/streaming-simple/05-assert.yaml rename to tests/e2e/streaming/streaming-simple/05-assert.yaml diff --git a/tests/e2e/streaming-simple/05-install.yaml b/tests/e2e/streaming/streaming-simple/05-install.yaml similarity index 100% rename from tests/e2e/streaming-simple/05-install.yaml rename to tests/e2e/streaming/streaming-simple/05-install.yaml diff --git a/tests/e2e/streaming-with-autoprovisioning/.gitignore b/tests/e2e/streaming/streaming-with-autoprovisioning/.gitignore similarity index 54% rename from tests/e2e/streaming-with-autoprovisioning/.gitignore rename to tests/e2e/streaming/streaming-with-autoprovisioning/.gitignore index d097e6be7..b2fb735ae 100644 --- a/tests/e2e/streaming-with-autoprovisioning/.gitignore +++ b/tests/e2e/streaming/streaming-with-autoprovisioning/.gitignore @@ -1,6 +1,7 @@ 01-assert.yaml +01-install.yaml 02-assert.yaml 03-assert.yaml 04-assert.yaml -06-assert.yaml -06-smoke-test.yaml +05-assert.yaml +05-smoke-test.yaml diff --git a/tests/e2e/streaming-with-autoprovisioning/00-assert.yaml b/tests/e2e/streaming/streaming-with-autoprovisioning/00-assert.yaml similarity index 100% rename from tests/e2e/streaming-with-autoprovisioning/00-assert.yaml rename to tests/e2e/streaming/streaming-with-autoprovisioning/00-assert.yaml diff --git a/tests/e2e/streaming/streaming-with-autoprovisioning/00-install.yaml b/tests/e2e/streaming/streaming-with-autoprovisioning/00-install.yaml new file mode 100644 index 000000000..0fb5b2266 --- /dev/null +++ b/tests/e2e/streaming/streaming-with-autoprovisioning/00-install.yaml @@ -0,0 +1,6 @@ +# Start Kafka +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: "cd ../../../.. && KAFKA_NAMESPACE=$NAMESPACE make undeploy-kafka-operator" + - script: "cd ../../../.. && KAFKA_NAMESPACE=$NAMESPACE make deploy-kafka-operator" diff --git a/tests/e2e/streaming-with-autoprovisioning/02-install.yaml b/tests/e2e/streaming/streaming-with-autoprovisioning/02-install.yaml similarity index 100% rename from tests/e2e/streaming-with-autoprovisioning/02-install.yaml rename to tests/e2e/streaming/streaming-with-autoprovisioning/02-install.yaml diff --git a/tests/e2e/examples-with-sampling/02-assert.yaml b/tests/e2e/streaming/streaming-with-autoprovisioning/06-assert.yaml similarity index 100% rename from tests/e2e/examples-with-sampling/02-assert.yaml rename to tests/e2e/streaming/streaming-with-autoprovisioning/06-assert.yaml diff --git a/tests/e2e/streaming-with-autoprovisioning/05-smoke-test.yaml b/tests/e2e/streaming/streaming-with-autoprovisioning/06-smoke-test.yaml similarity index 92% rename from tests/e2e/streaming-with-autoprovisioning/05-smoke-test.yaml rename to tests/e2e/streaming/streaming-with-autoprovisioning/06-smoke-test.yaml index ab19d0aad..4c3205001 100644 --- a/tests/e2e/streaming-with-autoprovisioning/05-smoke-test.yaml +++ b/tests/e2e/streaming/streaming-with-autoprovisioning/06-smoke-test.yaml @@ -24,7 +24,6 @@ spec: - name: JAEGER_QUERY value: "http://auto-provisioned-query:16686/api/traces" restartPolicy: OnFailure - backoffLimit: 10 --- apiVersion: batch/v1 kind: Job @@ -41,6 +40,5 @@ spec: - name: SERVICE_NAME value: "streaming-with-autoprovisioning" - name: QUERY_HOST - value: "auto-provisioned-query:16686" + value: "http://auto-provisioned-query:16686" restartPolicy: OnFailure - backoffLimit: 10 diff --git a/tests/e2e/streaming-with-tls/.gitignore b/tests/e2e/streaming/streaming-with-tls/.gitignore similarity index 100% rename from tests/e2e/streaming-with-tls/.gitignore rename to tests/e2e/streaming/streaming-with-tls/.gitignore diff --git a/tests/e2e/streaming/streaming-with-tls/00-install.yaml b/tests/e2e/streaming/streaming-with-tls/00-install.yaml new file mode 100644 index 000000000..1a36dc130 --- /dev/null +++ b/tests/e2e/streaming/streaming-with-tls/00-install.yaml @@ -0,0 +1,6 @@ +# Start Kafka +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: "cd ../../../.. && KAFKA_NAMESPACE=$NAMESPACE make undeploy-kafka" + - script: "cd ../../../.. && KAFKA_NAMESPACE=$NAMESPACE make kafka" diff --git a/tests/e2e/streaming-with-tls/05-assert.yaml b/tests/e2e/streaming/streaming-with-tls/05-assert.yaml similarity index 100% rename from tests/e2e/streaming-with-tls/05-assert.yaml rename to tests/e2e/streaming/streaming-with-tls/05-assert.yaml diff --git a/tests/e2e/streaming-with-tls/05-install.yaml b/tests/e2e/streaming/streaming-with-tls/05-install.yaml similarity index 100% rename from tests/e2e/streaming-with-tls/05-install.yaml rename to tests/e2e/streaming/streaming-with-tls/05-install.yaml diff --git a/tests/e2e/streaming-with-tls/06-assert.yaml b/tests/e2e/streaming/streaming-with-tls/06-assert.yaml similarity index 100% rename from tests/e2e/streaming-with-tls/06-assert.yaml rename to tests/e2e/streaming/streaming-with-tls/06-assert.yaml diff --git a/tests/e2e/streaming-with-tls/06-install.yaml b/tests/e2e/streaming/streaming-with-tls/06-install.yaml similarity index 100% rename from tests/e2e/streaming-with-tls/06-install.yaml rename to tests/e2e/streaming/streaming-with-tls/06-install.yaml diff --git a/tests/e2e/upgrade/.gitignore b/tests/e2e/upgrade/.gitignore index 89b211809..e7b239632 100644 --- a/tests/e2e/upgrade/.gitignore +++ b/tests/e2e/upgrade/.gitignore @@ -1,4 +1 @@ -00-assert.yaml -01-assert.yaml -02-assert.yaml -operator-upgrade.yaml +kuttl-test.yaml diff --git a/tests/e2e/upgrade/00-install.yaml b/tests/e2e/upgrade/00-install.yaml deleted file mode 100644 index 7094625c8..000000000 --- a/tests/e2e/upgrade/00-install.yaml +++ /dev/null @@ -1,9 +0,0 @@ -# Deploy a Jaeger instance -# The 00-assert.yaml file is generated by the prepare-e2e-kuttl-tests make -# rule. It will try to assert the Jaeger instance uses the current container -# version -apiVersion: jaegertracing.io/v1 -kind: Jaeger -metadata: - name: my-jaeger -spec: {} diff --git a/tests/e2e/upgrade/02-recover.yaml b/tests/e2e/upgrade/02-recover.yaml deleted file mode 100644 index 47dc485da..000000000 --- a/tests/e2e/upgrade/02-recover.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - # As explained in previous steps from this E2E test, this test is not totally - # isolated. So, to decrease the impact of #1575, the original configuration - # of the Jaeger Operator is applied here - # - # The 02-assert.yaml file is generated by the prepare-e2e-kuttl-tests make - # rule. It will try to assert the Jaeger instance uses the current container - # version (the one used before the change in the Jaeger Operator) - - script: "kubectl apply -f ../../_build/manifests/01-jaeger-operator.yaml -n observability" diff --git a/tests/e2e/upgrade/Makefile b/tests/e2e/upgrade/Makefile new file mode 100644 index 000000000..bc0cc1dff --- /dev/null +++ b/tests/e2e/upgrade/Makefile @@ -0,0 +1,6 @@ +render-e2e-tests-upgrade: TEST_SUITE_NAME=upgrade +render-e2e-tests-upgrade: generate-kuttl-config generate-e2e-files + JAEGER_VERSION=${JAEGER_VERSION} ./tests/e2e/upgrade/render.sh + +run-e2e-tests-upgrade: TEST_SUITE_NAME=upgrade +run-e2e-tests-upgrade: run-suite-tests diff --git a/tests/e2e/upgrade/render.sh b/tests/e2e/upgrade/render.sh new file mode 100755 index 000000000..2941d3f49 --- /dev/null +++ b/tests/e2e/upgrade/render.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +source $(dirname "$0")/../render-utils.sh + +cd $SUITE_DIR + +echo "Rendering templates for upgrade test" +cd upgrade +$GOMPLATE -f ./deployment-assert.yaml.template -o ./00-assert.yaml +JAEGER_VERSION=$($ROOT_DIR/.ci/get_test_upgrade_version.sh $JAEGER_VERSION) $GOMPLATE -f ./deployment-assert.yaml.template -o ./01-assert.yaml +sed "s~local/jaeger-operator:e2e~local/jaeger-operator:next~gi" $ROOT_DIR/tests/_build/manifests/01-jaeger-operator.yaml > ./operator-upgrade.yaml diff --git a/tests/e2e/upgrade/upgrade/.gitignore b/tests/e2e/upgrade/upgrade/.gitignore new file mode 100644 index 000000000..495fb6760 --- /dev/null +++ b/tests/e2e/upgrade/upgrade/.gitignore @@ -0,0 +1,3 @@ +00-assert.yaml +01-assert.yaml +operator-upgrade.yaml diff --git a/tests/e2e/upgrade/upgrade/00-install.yaml b/tests/e2e/upgrade/upgrade/00-install.yaml new file mode 100644 index 000000000..bf300ed1b --- /dev/null +++ b/tests/e2e/upgrade/upgrade/00-install.yaml @@ -0,0 +1,6 @@ +# Deploy a Jaeger instance +apiVersion: jaegertracing.io/v1 +kind: Jaeger +metadata: + name: my-jaeger +spec: {} diff --git a/tests/e2e/upgrade/01-replace.yaml b/tests/e2e/upgrade/upgrade/01-replace.yaml similarity index 80% rename from tests/e2e/upgrade/01-replace.yaml rename to tests/e2e/upgrade/upgrade/01-replace.yaml index 0c71703a4..402524d1d 100644 --- a/tests/e2e/upgrade/01-replace.yaml +++ b/tests/e2e/upgrade/upgrade/01-replace.yaml @@ -4,9 +4,7 @@ commands: # Before executing the KUTTL tests, the Jaeger Operator is deployed in the # observability namespace. To run this test, we modify that # deployment modifying the container image to use (that is the same executable - # but compiled using a different version number). For that reason, the test - # is not isolated. TODO: task #1575. - # + # but compiled using a different version number). # The 01-assert.yaml file is generated by the prepare-e2e-kuttl-tests make # rule. It will try to assert the Jaeger instance uses the next container # version diff --git a/tests/e2e/upgrade/deployment-assert.yaml.template b/tests/e2e/upgrade/upgrade/deployment-assert.yaml.template similarity index 100% rename from tests/e2e/upgrade/deployment-assert.yaml.template rename to tests/e2e/upgrade/upgrade/deployment-assert.yaml.template diff --git a/tests/e2e/sidecar/05-find-service-other-instance.yaml b/tests/templates/assert-find-service.yaml.template similarity index 52% rename from tests/e2e/sidecar/05-find-service-other-instance.yaml rename to tests/templates/assert-find-service.yaml.template index a3650cc45..c28eee8d8 100644 --- a/tests/e2e/sidecar/05-find-service-other-instance.yaml +++ b/tests/templates/assert-find-service.yaml.template @@ -1,7 +1,7 @@ apiVersion: batch/v1 kind: Job metadata: - name: find-service2 + name: find-service{{if getenv "JOB_NUMBER"}}-{{ .Env.JOB_NUMBER }}{{end}} spec: template: spec: @@ -11,8 +11,7 @@ spec: command: ["./query"] env: - name: SERVICE_NAME - value: "order" + value: "{{ .Env.JAEGER_SERVICE }}" - name: QUERY_HOST - value: "agent-as-sidecar2-query:16686" + value: "http://{{ .Env.JAEGER_NAME }}-query{{if getenv "KUBERNETES_NAMESPACE"}}.{{ .Env.KUBERNETES_NAMESPACE }}{{end}}:16686" restartPolicy: OnFailure - backoffLimit: 10 diff --git a/tests/templates/assert-ingress.yaml.template b/tests/templates/assert-ingress.yaml.template new file mode 100644 index 000000000..8e9654b74 --- /dev/null +++ b/tests/templates/assert-ingress.yaml.template @@ -0,0 +1,8 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Env.ROUTE_NAME }} +spec: + defaultBackend: + service: + name: {{ .Env.DESTINATION_NAME }} diff --git a/tests/templates/cassandra-jaeger-assert.yaml.template b/tests/templates/cassandra-jaeger-assert.yaml.template index 02c46a37d..6a70a5e7f 100644 --- a/tests/templates/cassandra-jaeger-assert.yaml.template +++ b/tests/templates/cassandra-jaeger-assert.yaml.template @@ -1,8 +1,8 @@ -# Assert the Jaeger is up and running +# Assert the Cassandra deployment is up and running apiVersion: apps/v1 kind: Deployment metadata: - name: {{ .Env.INSTANCE_NAME }} + name: {{ .Env.CASSANDRA_INSTANCE_NAME }} spec: replicas: 1 status: diff --git a/tests/templates/cassandra-jaeger-install.yaml.template b/tests/templates/cassandra-jaeger-install.yaml.template index 1b07e0fbb..d5dae3eb6 100644 --- a/tests/templates/cassandra-jaeger-install.yaml.template +++ b/tests/templates/cassandra-jaeger-install.yaml.template @@ -2,7 +2,7 @@ apiVersion: jaegertracing.io/v1 kind: Jaeger metadata: - name: {{ .Env.INSTANCE_NAME }} + name: {{ .Env.CASSANDRA_INSTANCE_NAME }} spec: strategy: allInOne storage: @@ -10,7 +10,7 @@ spec: {{- if (has .Env "DEP_SCHEDULE")}} dependencies: # run immediately - schedule: "*/1 * * * *" + schedule: "*/1 * * * *" {{- end }} options: cassandra: diff --git a/tests/templates/ensure-ingress-host.sh.template b/tests/templates/ensure-ingress-host.sh.template new file mode 100644 index 000000000..ec2f1cea4 --- /dev/null +++ b/tests/templates/ensure-ingress-host.sh.template @@ -0,0 +1,20 @@ +#!/bin/bash + +KUBECTL=$(which kubectl) +echo "Checking the Ingress host value was populated" +n=0 +until [ "$n" -ge 30 ] +do + echo "Try number $n" + INGRESS_HOSTNAME=$({{ .Env.GET_URL_COMMAND }}) + if [[ $INGRESS_HOSTNAME != "" ]] + then + echo "Hostname is $INGRESS_HOSTNAME" + exit 0 + fi + + n=$((n+1)) + sleep 10 +done + +exit 1 diff --git a/tests/templates/find-service-from-client.yaml.template b/tests/templates/find-service-from-client.yaml.template new file mode 100644 index 000000000..a9c8e9d12 --- /dev/null +++ b/tests/templates/find-service-from-client.yaml.template @@ -0,0 +1,7 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + # Sometimes, the Ingress route is there but not 100% ready so, when kubectl tries to get the + # hostname, it returns an empty string + - command: ./ensure-ingress-host.sh + - script: "go run ../../../assert-jobs/query/main.go --service-name={{ .Env.JAEGER_SERVICE }} --query-host={{ .Env.QUERY_HOST }}" diff --git a/tests/e2e/sidecar/02-find-service.yaml b/tests/templates/find-service.yaml.template similarity index 52% rename from tests/e2e/sidecar/02-find-service.yaml rename to tests/templates/find-service.yaml.template index 57c127c9e..c28eee8d8 100644 --- a/tests/e2e/sidecar/02-find-service.yaml +++ b/tests/templates/find-service.yaml.template @@ -1,7 +1,7 @@ apiVersion: batch/v1 kind: Job metadata: - name: find-service + name: find-service{{if getenv "JOB_NUMBER"}}-{{ .Env.JOB_NUMBER }}{{end}} spec: template: spec: @@ -11,8 +11,7 @@ spec: command: ["./query"] env: - name: SERVICE_NAME - value: "order" + value: "{{ .Env.JAEGER_SERVICE }}" - name: QUERY_HOST - value: "agent-as-sidecar-query:16686" + value: "http://{{ .Env.JAEGER_NAME }}-query{{if getenv "KUBERNETES_NAMESPACE"}}.{{ .Env.KUBERNETES_NAMESPACE }}{{end}}:16686" restartPolicy: OnFailure - backoffLimit: 10 diff --git a/kuttl-test.yaml b/tests/templates/kuttl-test.yaml similarity index 76% rename from kuttl-test.yaml rename to tests/templates/kuttl-test.yaml index 09bdcf32b..4ba74d47c 100644 --- a/kuttl-test.yaml +++ b/tests/templates/kuttl-test.yaml @@ -1,15 +1,15 @@ apiVersion: kuttl.dev/v1beta1 kind: TestSuite -crdDir: ./tests/_build/crds/ -artifactsDir: ./tests/_build/artifacts/ +crdDir: ../../_build/crds/ +artifactsDir: ../../_build/artifacts/ commands: - script: kubectl create namespace observability 2>&1 | grep -v "already exists" || true - - command: kubectl apply -f ./tests/_build/manifests/01-jaeger-operator.yaml -n observability + - command: kubectl apply -f ../../_build/manifests/01-jaeger-operator.yaml -n observability - command: kubectl wait --timeout=5m --for=condition=available deployment jaeger-operator -n observability - command: kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.0.1/deploy/static/provider/kind/deploy.yaml - command: kubectl wait --namespace ingress-nginx --for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=150s - command: sleep 5s testDirs: - - ./tests/e2e/ + - . timeout: 330 parallel: 1 diff --git a/tests/templates/smoke-test.yaml.template b/tests/templates/smoke-test.yaml.template index 1f0c54ccd..42e82a6c9 100644 --- a/tests/templates/smoke-test.yaml.template +++ b/tests/templates/smoke-test.yaml.template @@ -24,7 +24,6 @@ spec: - name: JAEGER_QUERY value: "http://{{ .Env.JAEGER_NAME }}-query{{if getenv "KUBERNETES_NAMESPACE"}}.{{ .Env.KUBERNETES_NAMESPACE }}{{end}}:16686/api/traces" restartPolicy: OnFailure - backoffLimit: 10 --- apiVersion: batch/v1 kind: Job @@ -41,6 +40,5 @@ spec: - name: SERVICE_NAME value: "{{ .Env.JAEGER_SERVICE }}" - name: QUERY_HOST - value: "{{ .Env.JAEGER_NAME }}-query{{if getenv "KUBERNETES_NAMESPACE"}}.{{ .Env.KUBERNETES_NAMESPACE }}{{end}}:16686" + value: "http://{{ .Env.JAEGER_NAME }}-query{{if getenv "KUBERNETES_NAMESPACE"}}.{{ .Env.KUBERNETES_NAMESPACE }}{{end}}:16686" restartPolicy: OnFailure - backoffLimit: 10 diff --git a/tests/templates/test-uiconfig.yaml.template b/tests/templates/test-uiconfig.yaml.template new file mode 100644 index 000000000..f06d8cfe7 --- /dev/null +++ b/tests/templates/test-uiconfig.yaml.template @@ -0,0 +1,19 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: test-ui-config +spec: + template: + spec: + containers: + - name: asserts-container + image: local/asserts:e2e + command: ["./uiconfig"] + env: + - name: QUERY_HOSTNAME + value: "{{ .Env.QUERY_HOSTNAME }}" + - name: QUERY_BASE_PATH + value: "{{ .Env.QUERY_BASE_PATH }}" + - name: TRACKING-ID + value: "{{ .Env.TRACKING_ID }}" + restartPolicy: OnFailure