From 431038e8770b28dc3b0ca586fce06845f6329eb6 Mon Sep 17 00:00:00 2001 From: Israel Blancas Date: Wed, 6 Apr 2022 14:59:35 +0200 Subject: [PATCH] Join multiple E2E test suites in one (#1783) * Join multiple E2E test suites in one Signed-off-by: Israel Blancas * Templatize the name of the concurrency groups Signed-off-by: Israel Blancas * Fix Makefile rule Signed-off-by: Israel Blancas Co-authored-by: Ruben Vargas --- .github/workflows/e2e-allinone.yaml | 2 +- .github/workflows/e2e-elasticsearch.yaml | 2 +- .github/workflows/e2e-examples.yaml | 2 +- .github/workflows/e2e-generate.yaml | 2 +- .github/workflows/e2e-istio.yaml | 34 ------------------- ...-cassandra.yaml => e2e-miscellaneous.yaml} | 10 +++--- .github/workflows/e2e-outside-cluster.yaml | 34 ------------------- .github/workflows/e2e-sidecar.yaml | 2 +- .github/workflows/e2e-streaming.yaml | 2 +- .github/workflows/e2e-upgrade.yaml | 2 +- tests/e2e/cassandra/Makefile | 5 --- .../cassandra/cassandra-smoke/02-assert.yaml | 15 -------- tests/e2e/cassandra/render.sh | 26 -------------- tests/e2e/istio/.gitignore | 1 - tests/e2e/istio/Makefile | 5 --- tests/e2e/istio/istio/.gitignore | 3 -- tests/e2e/miscellaneous/Makefile | 5 +++ .../cassandra-spark/01-assert.yaml | 0 .../istio/00-assert.yaml | 0 .../istio/00-install.yaml | 0 .../istio/01-assert.yaml | 0 .../istio/01-install.yaml | 0 .../istio/02-assert.yaml | 0 .../istio/02-install.yaml | 0 .../istio/03-assert.yaml | 0 .../istio/livelinessprobe.template | 0 .../istio/patch-04-find-service.yaml.template | 0 .../outside-cluster/02-assert.yaml | 0 .../outside-cluster/02-install.yaml | 0 .../03-check-collector.yaml.template | 0 tests/e2e/{istio => miscellaneous}/render.sh | 17 ++++++++++ tests/e2e/outside-cluster/.gitignore | 1 - tests/e2e/outside-cluster/Makefile | 5 --- tests/e2e/outside-cluster/render.sh | 9 ----- 34 files changed, 34 insertions(+), 150 deletions(-) delete mode 100644 .github/workflows/e2e-istio.yaml rename .github/workflows/{e2e-cassandra.yaml => e2e-miscellaneous.yaml} (72%) delete mode 100644 .github/workflows/e2e-outside-cluster.yaml delete mode 100644 tests/e2e/cassandra/Makefile delete mode 100644 tests/e2e/cassandra/cassandra-smoke/02-assert.yaml delete mode 100755 tests/e2e/cassandra/render.sh delete mode 100644 tests/e2e/istio/.gitignore delete mode 100644 tests/e2e/istio/Makefile delete mode 100644 tests/e2e/istio/istio/.gitignore create mode 100644 tests/e2e/miscellaneous/Makefile rename tests/e2e/{cassandra => miscellaneous}/cassandra-spark/01-assert.yaml (100%) rename tests/e2e/{istio => miscellaneous}/istio/00-assert.yaml (100%) rename tests/e2e/{istio => miscellaneous}/istio/00-install.yaml (100%) rename tests/e2e/{istio => miscellaneous}/istio/01-assert.yaml (100%) rename tests/e2e/{istio => miscellaneous}/istio/01-install.yaml (100%) rename tests/e2e/{istio => miscellaneous}/istio/02-assert.yaml (100%) rename tests/e2e/{istio => miscellaneous}/istio/02-install.yaml (100%) rename tests/e2e/{istio => miscellaneous}/istio/03-assert.yaml (100%) rename tests/e2e/{istio => miscellaneous}/istio/livelinessprobe.template (100%) rename tests/e2e/{istio => miscellaneous}/istio/patch-04-find-service.yaml.template (100%) rename tests/e2e/{outside-cluster => miscellaneous}/outside-cluster/02-assert.yaml (100%) rename tests/e2e/{outside-cluster => miscellaneous}/outside-cluster/02-install.yaml (100%) rename tests/e2e/{outside-cluster => miscellaneous}/outside-cluster/03-check-collector.yaml.template (100%) rename tests/e2e/{istio => miscellaneous}/render.sh (71%) delete mode 100644 tests/e2e/outside-cluster/.gitignore delete mode 100644 tests/e2e/outside-cluster/Makefile delete mode 100755 tests/e2e/outside-cluster/render.sh diff --git a/.github/workflows/e2e-allinone.yaml b/.github/workflows/e2e-allinone.yaml index d0c6a223c..f628a9ed8 100644 --- a/.github/workflows/e2e-allinone.yaml +++ b/.github/workflows/e2e-allinone.yaml @@ -11,7 +11,7 @@ on: - '**.md' concurrency: - group: e2e-tests-${{ github.ref }}-allinone + group: e2e-tests-${{ github.ref }}-${{ github.workflow }} cancel-in-progress: true jobs: diff --git a/.github/workflows/e2e-elasticsearch.yaml b/.github/workflows/e2e-elasticsearch.yaml index b0ee77b1b..ef419f026 100644 --- a/.github/workflows/e2e-elasticsearch.yaml +++ b/.github/workflows/e2e-elasticsearch.yaml @@ -11,7 +11,7 @@ on: - '**.md' concurrency: - group: e2e-tests-${{ github.ref }}-elasticsearch + group: e2e-tests-${{ github.ref }}-${{ github.workflow }} cancel-in-progress: true jobs: diff --git a/.github/workflows/e2e-examples.yaml b/.github/workflows/e2e-examples.yaml index 0710f5148..f86183f4b 100644 --- a/.github/workflows/e2e-examples.yaml +++ b/.github/workflows/e2e-examples.yaml @@ -11,7 +11,7 @@ on: - '**.md' concurrency: - group: e2e-tests-${{ github.ref }}-examples + group: e2e-tests-${{ github.ref }}-${{ github.workflow }} cancel-in-progress: true jobs: diff --git a/.github/workflows/e2e-generate.yaml b/.github/workflows/e2e-generate.yaml index 134dfeebc..24b172fe6 100644 --- a/.github/workflows/e2e-generate.yaml +++ b/.github/workflows/e2e-generate.yaml @@ -11,7 +11,7 @@ on: - '**.md' concurrency: - group: e2e-tests-${{ github.ref }}-generate + group: e2e-tests-${{ github.ref }}-${{ github.workflow }} cancel-in-progress: true jobs: diff --git a/.github/workflows/e2e-istio.yaml b/.github/workflows/e2e-istio.yaml deleted file mode 100644 index ae1b06e28..000000000 --- a/.github/workflows/e2e-istio.yaml +++ /dev/null @@ -1,34 +0,0 @@ -name: Istio E2E tests - -on: - push: - branches: [ main ] - paths-ignore: - - '**.md' - pull_request: - branches: [ main ] - paths-ignore: - - '**.md' - -concurrency: - group: e2e-tests-${{ github.ref }}-istio - cancel-in-progress: true - -jobs: - run-e2e-istio-test-suite: - runs-on: ubuntu-20.04 - strategy: - matrix: - kube-version: - - "1.19" - - "1.23" - name: Run Istio E2E tests - steps: - - name: "Check out code into the Go module directory" - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: ./hack/actions/e2e - with: - testsuite_name: istio - kube_version: ${{ matrix.kube-version }} diff --git a/.github/workflows/e2e-cassandra.yaml b/.github/workflows/e2e-miscellaneous.yaml similarity index 72% rename from .github/workflows/e2e-cassandra.yaml rename to .github/workflows/e2e-miscellaneous.yaml index 0e79c9e38..74ae574f7 100644 --- a/.github/workflows/e2e-cassandra.yaml +++ b/.github/workflows/e2e-miscellaneous.yaml @@ -1,4 +1,4 @@ -name: Cassandra E2E tests +name: Miscellaneous E2E tests on: push: @@ -11,18 +11,18 @@ on: - '**.md' concurrency: - group: e2e-tests-${{ github.ref }}-cassandra + group: e2e-tests-${{ github.ref }}-${{ github.workflow }} cancel-in-progress: true jobs: - run-e2e-cassandra-test-suite: + run-e2e-miscellaneous-test-suite: runs-on: ubuntu-20.04 strategy: matrix: kube-version: - "1.19" - "1.23" - name: Run Cassandra E2E tests + name: Run miscellaneous E2E tests steps: - name: "Check out code into the Go module directory" uses: actions/checkout@v3 @@ -30,5 +30,5 @@ jobs: fetch-depth: 0 - uses: ./hack/actions/e2e with: - testsuite_name: cassandra + testsuite_name: miscellaneous kube_version: ${{ matrix.kube-version }} diff --git a/.github/workflows/e2e-outside-cluster.yaml b/.github/workflows/e2e-outside-cluster.yaml deleted file mode 100644 index 48ce9d5e5..000000000 --- a/.github/workflows/e2e-outside-cluster.yaml +++ /dev/null @@ -1,34 +0,0 @@ -name: Outside cluster E2E tests - -on: - push: - branches: [ main ] - paths-ignore: - - '**.md' - pull_request: - branches: [ main ] - paths-ignore: - - '**.md' - -concurrency: - group: e2e-tests-${{ github.ref }}-outside-cluster - cancel-in-progress: true - -jobs: - run-e2e-outside-cluster-test-suite: - runs-on: ubuntu-20.04 - strategy: - matrix: - kube-version: - - "1.19" - - "1.23" - name: Run outside cluster E2E tests - steps: - - name: "Check out code into the Go module directory" - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: ./hack/actions/e2e - with: - testsuite_name: outside-cluster - kube_version: ${{ matrix.kube-version }} diff --git a/.github/workflows/e2e-sidecar.yaml b/.github/workflows/e2e-sidecar.yaml index ce7551c39..866162b03 100644 --- a/.github/workflows/e2e-sidecar.yaml +++ b/.github/workflows/e2e-sidecar.yaml @@ -11,7 +11,7 @@ on: - '**.md' concurrency: - group: e2e-tests-${{ github.ref }}-sidecar + group: e2e-tests-${{ github.ref }}-${{ github.workflow }} cancel-in-progress: true jobs: diff --git a/.github/workflows/e2e-streaming.yaml b/.github/workflows/e2e-streaming.yaml index 09c83ae7c..31ae6603e 100644 --- a/.github/workflows/e2e-streaming.yaml +++ b/.github/workflows/e2e-streaming.yaml @@ -11,7 +11,7 @@ on: - '**.md' concurrency: - group: e2e-tests-${{ github.ref }}-streaming + group: e2e-tests-${{ github.ref }}-${{ github.workflow }} cancel-in-progress: true jobs: diff --git a/.github/workflows/e2e-upgrade.yaml b/.github/workflows/e2e-upgrade.yaml index 473b5cf1d..ccbf0c686 100644 --- a/.github/workflows/e2e-upgrade.yaml +++ b/.github/workflows/e2e-upgrade.yaml @@ -11,7 +11,7 @@ on: - '**.md' concurrency: - group: e2e-tests-${{ github.ref }}-upgrade + group: e2e-tests-${{ github.ref }}-${{ github.workflow }} cancel-in-progress: true jobs: diff --git a/tests/e2e/cassandra/Makefile b/tests/e2e/cassandra/Makefile deleted file mode 100644 index 692f53674..000000000 --- a/tests/e2e/cassandra/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -render-e2e-tests-cassandra: load-assert-job - ./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/02-assert.yaml b/tests/e2e/cassandra/cassandra-smoke/02-assert.yaml deleted file mode 100644 index 9110f0ed9..000000000 --- a/tests/e2e/cassandra/cassandra-smoke/02-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/cassandra/render.sh b/tests/e2e/cassandra/render.sh deleted file mode 100755 index e17cb4247..000000000 --- a/tests/e2e/cassandra/render.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -source $(dirname "$0")/../render-utils.sh - -start_test "cassandra-smoke" -export jaeger_name=with-cassandra - -# Create Cassandra instance and assert it -render_install_cassandra "00" - -# Create the Jaeger instance -render_install_jaeger "$jaeger_name" "production_cassandra" "01" - -# Run smoke test -render_smoke_test "$jaeger_name" "production" "02" - - -start_test "cassandra-spark" -# Create Cassandra instance and assert it -render_install_cassandra "00" - -# Create the Jaeger instance -export JAEGER_NAME=test-spark-deps -export DEP_SCHEDULE=true -export CASSANDRA_MODE=prod -$GOMPLATE -f $TEMPLATES_DIR/cassandra-jaeger-install.yaml.template -o ./01-install.yaml diff --git a/tests/e2e/istio/.gitignore b/tests/e2e/istio/.gitignore deleted file mode 100644 index e7b239632..000000000 --- a/tests/e2e/istio/.gitignore +++ /dev/null @@ -1 +0,0 @@ -kuttl-test.yaml diff --git a/tests/e2e/istio/Makefile b/tests/e2e/istio/Makefile deleted file mode 100644 index 29eb09979..000000000 --- a/tests/e2e/istio/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -render-e2e-tests-istio: load-assert-job - ./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 deleted file mode 100644 index 7e6398518..000000000 --- a/tests/e2e/istio/istio/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -03-install.yaml -04-assert.yaml -04-smoke.yaml diff --git a/tests/e2e/miscellaneous/Makefile b/tests/e2e/miscellaneous/Makefile new file mode 100644 index 000000000..09ea8c866 --- /dev/null +++ b/tests/e2e/miscellaneous/Makefile @@ -0,0 +1,5 @@ +render-e2e-tests-miscellaneous: set-assert-e2e-img-name load-assert-job + SKIP_ES_EXTERNAL=$(SKIP_ES_EXTERNAL) ./tests/e2e/miscellaneous/render.sh + +run-e2e-tests-miscellaneous: TEST_SUITE_NAME=miscellaneous +run-e2e-tests-miscellaneous: run-suite-tests diff --git a/tests/e2e/cassandra/cassandra-spark/01-assert.yaml b/tests/e2e/miscellaneous/cassandra-spark/01-assert.yaml similarity index 100% rename from tests/e2e/cassandra/cassandra-spark/01-assert.yaml rename to tests/e2e/miscellaneous/cassandra-spark/01-assert.yaml diff --git a/tests/e2e/istio/istio/00-assert.yaml b/tests/e2e/miscellaneous/istio/00-assert.yaml similarity index 100% rename from tests/e2e/istio/istio/00-assert.yaml rename to tests/e2e/miscellaneous/istio/00-assert.yaml diff --git a/tests/e2e/istio/istio/00-install.yaml b/tests/e2e/miscellaneous/istio/00-install.yaml similarity index 100% rename from tests/e2e/istio/istio/00-install.yaml rename to tests/e2e/miscellaneous/istio/00-install.yaml diff --git a/tests/e2e/istio/istio/01-assert.yaml b/tests/e2e/miscellaneous/istio/01-assert.yaml similarity index 100% rename from tests/e2e/istio/istio/01-assert.yaml rename to tests/e2e/miscellaneous/istio/01-assert.yaml diff --git a/tests/e2e/istio/istio/01-install.yaml b/tests/e2e/miscellaneous/istio/01-install.yaml similarity index 100% rename from tests/e2e/istio/istio/01-install.yaml rename to tests/e2e/miscellaneous/istio/01-install.yaml diff --git a/tests/e2e/istio/istio/02-assert.yaml b/tests/e2e/miscellaneous/istio/02-assert.yaml similarity index 100% rename from tests/e2e/istio/istio/02-assert.yaml rename to tests/e2e/miscellaneous/istio/02-assert.yaml diff --git a/tests/e2e/istio/istio/02-install.yaml b/tests/e2e/miscellaneous/istio/02-install.yaml similarity index 100% rename from tests/e2e/istio/istio/02-install.yaml rename to tests/e2e/miscellaneous/istio/02-install.yaml diff --git a/tests/e2e/istio/istio/03-assert.yaml b/tests/e2e/miscellaneous/istio/03-assert.yaml similarity index 100% rename from tests/e2e/istio/istio/03-assert.yaml rename to tests/e2e/miscellaneous/istio/03-assert.yaml diff --git a/tests/e2e/istio/istio/livelinessprobe.template b/tests/e2e/miscellaneous/istio/livelinessprobe.template similarity index 100% rename from tests/e2e/istio/istio/livelinessprobe.template rename to tests/e2e/miscellaneous/istio/livelinessprobe.template diff --git a/tests/e2e/istio/istio/patch-04-find-service.yaml.template b/tests/e2e/miscellaneous/istio/patch-04-find-service.yaml.template similarity index 100% rename from tests/e2e/istio/istio/patch-04-find-service.yaml.template rename to tests/e2e/miscellaneous/istio/patch-04-find-service.yaml.template diff --git a/tests/e2e/outside-cluster/outside-cluster/02-assert.yaml b/tests/e2e/miscellaneous/outside-cluster/02-assert.yaml similarity index 100% rename from tests/e2e/outside-cluster/outside-cluster/02-assert.yaml rename to tests/e2e/miscellaneous/outside-cluster/02-assert.yaml diff --git a/tests/e2e/outside-cluster/outside-cluster/02-install.yaml b/tests/e2e/miscellaneous/outside-cluster/02-install.yaml similarity index 100% rename from tests/e2e/outside-cluster/outside-cluster/02-install.yaml rename to tests/e2e/miscellaneous/outside-cluster/02-install.yaml diff --git a/tests/e2e/outside-cluster/outside-cluster/03-check-collector.yaml.template b/tests/e2e/miscellaneous/outside-cluster/03-check-collector.yaml.template similarity index 100% rename from tests/e2e/outside-cluster/outside-cluster/03-check-collector.yaml.template rename to tests/e2e/miscellaneous/outside-cluster/03-check-collector.yaml.template diff --git a/tests/e2e/istio/render.sh b/tests/e2e/miscellaneous/render.sh similarity index 71% rename from tests/e2e/istio/render.sh rename to tests/e2e/miscellaneous/render.sh index f3dd1c38a..40061aba8 100755 --- a/tests/e2e/istio/render.sh +++ b/tests/e2e/miscellaneous/render.sh @@ -2,6 +2,16 @@ source $(dirname "$0")/../render-utils.sh +start_test "cassandra-spark" +# Create Cassandra instance and assert it +render_install_cassandra "00" +# Create the Jaeger instance +export JAEGER_NAME=test-spark-deps +export DEP_SCHEDULE=true +export CASSANDRA_MODE=prod +$GOMPLATE -f $TEMPLATES_DIR/cassandra-jaeger-install.yaml.template -o ./01-install.yaml + + if [ $IS_OPENSHIFT = true ]; then skip_test "istio" "Test not supported in OpenShift" else @@ -23,3 +33,10 @@ else $YQ e -i '.spec.template.spec.containers[0].command = ["/bin/sh","-c"]' $patched_file $YQ e -i '.spec.template.spec.containers[0].args= ["./query && curl -sf -XPOST http://localhost:15000/quitquitquit"]' $patched_file fi + + +start_test "outside-cluster" +jaeger_name="my-jaeger" +render_install_elasticsearch "00" +render_install_jaeger "$jaeger_name" "production" "01" +$GOMPLATE -f ./03-check-collector.yaml.template -o 03-check-collector.yaml diff --git a/tests/e2e/outside-cluster/.gitignore b/tests/e2e/outside-cluster/.gitignore deleted file mode 100644 index e7b239632..000000000 --- a/tests/e2e/outside-cluster/.gitignore +++ /dev/null @@ -1 +0,0 @@ -kuttl-test.yaml diff --git a/tests/e2e/outside-cluster/Makefile b/tests/e2e/outside-cluster/Makefile deleted file mode 100644 index ad24a049e..000000000 --- a/tests/e2e/outside-cluster/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -render-e2e-tests-outside-cluster: load-elasticsarch-image - SKIP_ES_EXTERNAL=$(SKIP_ES_EXTERNAL) ./tests/e2e/outside-cluster/render.sh - -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/render.sh b/tests/e2e/outside-cluster/render.sh deleted file mode 100755 index 8d2c4e4c4..000000000 --- a/tests/e2e/outside-cluster/render.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -source $(dirname "$0")/../render-utils.sh - -start_test "outside-cluster" -jaeger_name="my-jaeger" -render_install_elasticsearch "00" -render_install_jaeger "$jaeger_name" "production" "01" -$GOMPLATE -f ./03-check-collector.yaml.template -o 03-check-collector.yaml