From ed152f0bfa9745780ad63cf85e33609b41926b24 Mon Sep 17 00:00:00 2001 From: odubajDT <93584209+odubajDT@users.noreply.github.com> Date: Mon, 22 Apr 2024 13:03:00 +0200 Subject: [PATCH] test: re-work test strategy for integration tests (#3443) Signed-off-by: odubajDT --- .../deploy-keptn-on-cluster/action.yml | 77 +++---------------- .../{ => values}/certificate.yaml | 0 ...values-integration-allowed-namespaces.yaml | 24 ++++++ .../values-integration-cert-manager.yaml | 23 ++++++ ...gration-gates_off-cert_manager_io_off.yaml | 27 +++++++ ...gration-gates_off-cert_manager_io_on.yaml} | 1 + ...egration-gates_on-cert_manager_io_off.yaml | 27 +++++++ .../values/values-integration-lifecycle.yaml | 25 ++++++ .../values/values-integration-metrics.yaml | 15 ++++ .../{ => values}/values.yaml | 0 .github/workflows/CI.yaml | 45 ++++++++++- .../workflows/integration-test-component.yml | 57 ++++++++++++++ .github/workflows/integration-test.yml | 25 +----- .github/workflows/security-scans.yml | 2 +- Makefile | 34 +++++--- .../cert-recreates/00-assert.yaml | 18 ----- .../cert-recreates/01-assert.yaml | 18 ----- .../cert-recreates/02-assert.yaml | 18 ----- .../cert-recreates/chainsaw-test.yaml | 1 - .../testmetrics/metrics-provider/logs.sh | 2 +- .../testmetrics/metrics/chainsaw-test.yaml | 15 ---- 21 files changed, 279 insertions(+), 175 deletions(-) rename .github/actions/deploy-keptn-on-cluster/{ => values}/certificate.yaml (100%) create mode 100644 .github/actions/deploy-keptn-on-cluster/values/values-integration-allowed-namespaces.yaml create mode 100644 .github/actions/deploy-keptn-on-cluster/values/values-integration-cert-manager.yaml create mode 100644 .github/actions/deploy-keptn-on-cluster/values/values-integration-gates_off-cert_manager_io_off.yaml rename .github/actions/deploy-keptn-on-cluster/{values-cert-manager-io.yaml => values/values-integration-gates_off-cert_manager_io_on.yaml} (94%) create mode 100644 .github/actions/deploy-keptn-on-cluster/values/values-integration-gates_on-cert_manager_io_off.yaml create mode 100644 .github/actions/deploy-keptn-on-cluster/values/values-integration-lifecycle.yaml create mode 100644 .github/actions/deploy-keptn-on-cluster/values/values-integration-metrics.yaml rename .github/actions/deploy-keptn-on-cluster/{ => values}/values.yaml (100%) create mode 100644 .github/workflows/integration-test-component.yml diff --git a/.github/actions/deploy-keptn-on-cluster/action.yml b/.github/actions/deploy-keptn-on-cluster/action.yml index 8dc1617e5a..8cb9826844 100644 --- a/.github/actions/deploy-keptn-on-cluster/action.yml +++ b/.github/actions/deploy-keptn-on-cluster/action.yml @@ -18,14 +18,10 @@ inputs: required: false description: "Name of the kind cluster" default: "test-cluster" - scheduling-gates: + values-file: required: false - description: "Use scheduling gates instead of scheduler" - default: "gates_off" - allowed-namespaces: - required: false - description: "Decides whether to allow only certain namespaces" - default: "allowed_ns_off" + description: "Values file used for Keptn installation configuration" + default: "values.yaml" cert-manager-io-enabled: required: false description: "Decides whether to use cert-manager.io" @@ -64,49 +60,6 @@ runs: kind load image-archive $image/$image -n ${{ inputs.cluster-name }} done - - name: Install Keptn with helm - if: inputs.cert-manager-io-enabled == 'cert_manager_io_off' - env: - RELEASE_REGISTRY: "localhost:5000/keptn" - shell: bash - run: | - echo "Installing Keptn using helm" - helm version - - helm repo add keptn "https://charts.lifecycle.keptn.sh" - helm repo update - - for chart_dir in ./lifecycle-operator/chart \ - ./metrics-operator/chart \ - ./keptn-cert-manager/chart \ - ./chart; do - cd "$chart_dir" - echo "updating charts for" $chart_dir - helm dependency update - helm dependency build - cd - # Return to the previous directory - done - - cd .github/actions/deploy-keptn-on-cluster - - if [ "${{ inputs.allowed-namespaces }}" == "allowed_ns_on" ]; then - echo " allowedNamespaces: [allowed-ns-test]" >> values.yaml - fi - - if [ "${{ inputs.scheduling-gates }}" == "gates_on" ]; then - echo " schedulingGatesEnabled: true" >> values.yaml - fi - - export TAG=${{ inputs.runtime_tag }} - envsubst < values.yaml > tmp.yaml - - echo "installing with values.yaml file:" - cat tmp.yaml - - helm install -n keptn-system --create-namespace keptn ../../../chart \ - --values ./tmp.yaml \ - --debug --wait --timeout 1m - - name: Install cert-manager.io if: inputs.cert-manager-io-enabled == 'cert_manager_io_on' env: @@ -118,8 +71,10 @@ runs: kubectl wait --for=condition=Available deployment/cert-manager-webhook -n cert-manager --timeout=120s kubectl wait --for=condition=ready pod -l app=webhook -n cert-manager --timeout=60s - - name: Install Keptn using cert-manager.io with helm - if: inputs.cert-manager-io-enabled == 'cert_manager_io_on' + kubectl create ns keptn-system + kubectl apply -f .github/actions/deploy-keptn-on-cluster/values/certificate.yaml + + - name: Install Keptn with helm env: RELEASE_REGISTRY: "localhost:5000/keptn" shell: bash @@ -132,6 +87,7 @@ runs: for chart_dir in ./lifecycle-operator/chart \ ./metrics-operator/chart \ + ./keptn-cert-manager/chart \ ./chart; do cd "$chart_dir" echo "updating charts for" $chart_dir @@ -142,23 +98,12 @@ runs: cd .github/actions/deploy-keptn-on-cluster - if [ "${{ inputs.allowed-namespaces }}" == "allowed_ns_on" ]; then - echo " allowedNamespaces: [allowed-ns-test]" >> values-cert-manager-io.yaml - fi - - if [ "${{ inputs.scheduling-gates }}" == "gates_on" ]; then - echo " schedulingGatesEnabled: true" >> values-cert-manager-io.yaml - fi - export TAG=${{ inputs.runtime_tag }} - envsubst < values-cert-manager-io.yaml > tmp.yaml + envsubst < values/${{ inputs.values-file }} > tmp.yaml - echo "installing with values-cert-manager-io.yaml file:" + echo "installing with values.yaml file:" cat tmp.yaml - kubectl create ns keptn-system - kubectl apply -f certificate.yaml - - helm install -n keptn-system keptn ../../../chart \ + helm install -n keptn-system --create-namespace keptn ../../../chart \ --values ./tmp.yaml \ --debug --wait --timeout 1m diff --git a/.github/actions/deploy-keptn-on-cluster/certificate.yaml b/.github/actions/deploy-keptn-on-cluster/values/certificate.yaml similarity index 100% rename from .github/actions/deploy-keptn-on-cluster/certificate.yaml rename to .github/actions/deploy-keptn-on-cluster/values/certificate.yaml diff --git a/.github/actions/deploy-keptn-on-cluster/values/values-integration-allowed-namespaces.yaml b/.github/actions/deploy-keptn-on-cluster/values/values-integration-allowed-namespaces.yaml new file mode 100644 index 0000000000..cc4e01ca34 --- /dev/null +++ b/.github/actions/deploy-keptn-on-cluster/values/values-integration-allowed-namespaces.yaml @@ -0,0 +1,24 @@ +global: + imageRegistry: "localhost:5000" + +certManager: + imagePullPolicy: Never + image: + tag: $TAG + +metricsOperator: + enabled: false + +lifecycleOperator: + lifecycleOperator: + imagePullPolicy: Never + image: + tag: $TAG + env: + functionRunnerImage: localhost:5000/keptn/deno-runtime:$TAG + pythonRunnerImage: localhost:5000/keptn/python-runtime:$TAG + scheduler: + imagePullPolicy: Never + image: + tag: $TAG + allowedNamespaces: [allowed-ns-test] diff --git a/.github/actions/deploy-keptn-on-cluster/values/values-integration-cert-manager.yaml b/.github/actions/deploy-keptn-on-cluster/values/values-integration-cert-manager.yaml new file mode 100644 index 0000000000..6450bfe001 --- /dev/null +++ b/.github/actions/deploy-keptn-on-cluster/values/values-integration-cert-manager.yaml @@ -0,0 +1,23 @@ +global: + imageRegistry: "localhost:5000" + +certManager: + imagePullPolicy: Never + image: + tag: $TAG + +metricsOperator: + enabled: false + +lifecycleOperator: + lifecycleOperator: + imagePullPolicy: Never + image: + tag: $TAG + env: + functionRunnerImage: localhost:5000/keptn/deno-runtime:$TAG + pythonRunnerImage: localhost:5000/keptn/python-runtime:$TAG + scheduler: + imagePullPolicy: Never + image: + tag: $TAG diff --git a/.github/actions/deploy-keptn-on-cluster/values/values-integration-gates_off-cert_manager_io_off.yaml b/.github/actions/deploy-keptn-on-cluster/values/values-integration-gates_off-cert_manager_io_off.yaml new file mode 100644 index 0000000000..6b0f595b6a --- /dev/null +++ b/.github/actions/deploy-keptn-on-cluster/values/values-integration-gates_off-cert_manager_io_off.yaml @@ -0,0 +1,27 @@ +global: + imageRegistry: "localhost:5000" + +certManager: + imagePullPolicy: Never + image: + tag: $TAG + +metricsOperator: + imagePullPolicy: Never + image: + tag: $TAG + +lifecycleOperator: + promotionTasksEnabled: true + lifecycleOperator: + imagePullPolicy: Never + image: + tag: $TAG + env: + functionRunnerImage: localhost:5000/keptn/deno-runtime:$TAG + pythonRunnerImage: localhost:5000/keptn/python-runtime:$TAG + scheduler: + imagePullPolicy: Never + image: + tag: $TAG + schedulingGatesEnabled: false diff --git a/.github/actions/deploy-keptn-on-cluster/values-cert-manager-io.yaml b/.github/actions/deploy-keptn-on-cluster/values/values-integration-gates_off-cert_manager_io_on.yaml similarity index 94% rename from .github/actions/deploy-keptn-on-cluster/values-cert-manager-io.yaml rename to .github/actions/deploy-keptn-on-cluster/values/values-integration-gates_off-cert_manager_io_on.yaml index bbb0a56d36..3d73a23c6b 100644 --- a/.github/actions/deploy-keptn-on-cluster/values-cert-manager-io.yaml +++ b/.github/actions/deploy-keptn-on-cluster/values/values-integration-gates_off-cert_manager_io_on.yaml @@ -22,3 +22,4 @@ lifecycleOperator: imagePullPolicy: Never image: tag: $TAG + schedulingGatesEnabled: false diff --git a/.github/actions/deploy-keptn-on-cluster/values/values-integration-gates_on-cert_manager_io_off.yaml b/.github/actions/deploy-keptn-on-cluster/values/values-integration-gates_on-cert_manager_io_off.yaml new file mode 100644 index 0000000000..b3b6fa5062 --- /dev/null +++ b/.github/actions/deploy-keptn-on-cluster/values/values-integration-gates_on-cert_manager_io_off.yaml @@ -0,0 +1,27 @@ +global: + imageRegistry: "localhost:5000" + +certManager: + imagePullPolicy: Never + image: + tag: $TAG + +metricsOperator: + imagePullPolicy: Never + image: + tag: $TAG + +lifecycleOperator: + promotionTasksEnabled: true + lifecycleOperator: + imagePullPolicy: Never + image: + tag: $TAG + env: + functionRunnerImage: localhost:5000/keptn/deno-runtime:$TAG + pythonRunnerImage: localhost:5000/keptn/python-runtime:$TAG + scheduler: + imagePullPolicy: Never + image: + tag: $TAG + schedulingGatesEnabled: true diff --git a/.github/actions/deploy-keptn-on-cluster/values/values-integration-lifecycle.yaml b/.github/actions/deploy-keptn-on-cluster/values/values-integration-lifecycle.yaml new file mode 100644 index 0000000000..33227e697e --- /dev/null +++ b/.github/actions/deploy-keptn-on-cluster/values/values-integration-lifecycle.yaml @@ -0,0 +1,25 @@ +global: + imageRegistry: "localhost:5000" + +certManager: + imagePullPolicy: Never + image: + tag: $TAG + +metricsOperator: + enabled: false + +lifecycleOperator: + promotionTasksEnabled: true + lifecycleOperator: + imagePullPolicy: Never + image: + tag: $TAG + env: + functionRunnerImage: localhost:5000/keptn/deno-runtime:$TAG + pythonRunnerImage: localhost:5000/keptn/python-runtime:$TAG + scheduler: + imagePullPolicy: Never + image: + tag: $TAG + schedulingGatesEnabled: true diff --git a/.github/actions/deploy-keptn-on-cluster/values/values-integration-metrics.yaml b/.github/actions/deploy-keptn-on-cluster/values/values-integration-metrics.yaml new file mode 100644 index 0000000000..706b0db5c9 --- /dev/null +++ b/.github/actions/deploy-keptn-on-cluster/values/values-integration-metrics.yaml @@ -0,0 +1,15 @@ +global: + imageRegistry: "localhost:5000" + +certManager: + imagePullPolicy: Never + image: + tag: $TAG + +metricsOperator: + imagePullPolicy: Never + image: + tag: $TAG + +lifecycleOperator: + enabled: false diff --git a/.github/actions/deploy-keptn-on-cluster/values.yaml b/.github/actions/deploy-keptn-on-cluster/values/values.yaml similarity index 100% rename from .github/actions/deploy-keptn-on-cluster/values.yaml rename to .github/actions/deploy-keptn-on-cluster/values/values.yaml diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index f70d065625..d193162c86 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -208,15 +208,56 @@ jobs: strategy: matrix: scheduling-gates: [gates_on, gates_off] - allowed-namespaces: [allowed_ns_on, allowed_ns_off] cert-manager-io-enabled: [cert_manager_io_on, cert_manager_io_off] + exclude: + - scheduling-gates: gates_on + cert-manager-io-enabled: cert_manager_io_on with: runtime_tag: dev-${{ needs.prepare_ci_run.outputs.DATETIME }} scheduling-gates: ${{ matrix.scheduling-gates }} - allowed-namespaces: ${{ matrix.allowed-namespaces }} cert-manager-io-enabled: ${{ matrix.cert-manager-io-enabled }} uses: ./.github/workflows/integration-test.yml + integration_tests_allowed_namespaces: + name: Integration Tests Allowed Namespaces + needs: + - prepare_ci_run + - build_image + with: + runtime_tag: dev-${{ needs.prepare_ci_run.outputs.DATETIME }} + type: allowed-namespaces + uses: ./.github/workflows/integration-test-component.yml + + integration_tests_lifecycle: + name: Integration Tests Lifecycle + needs: + - prepare_ci_run + - build_image + with: + runtime_tag: dev-${{ needs.prepare_ci_run.outputs.DATETIME }} + type: lifecycle + uses: ./.github/workflows/integration-test-component.yml + + integration_tests_metrics: + name: Integration Tests Metrics + needs: + - prepare_ci_run + - build_image + with: + runtime_tag: dev-${{ needs.prepare_ci_run.outputs.DATETIME }} + type: metrics + uses: ./.github/workflows/integration-test-component.yml + + integration_tests_cert_manager: + name: Integration Tests Cert Manager + needs: + - prepare_ci_run + - build_image + with: + runtime_tag: dev-${{ needs.prepare_ci_run.outputs.DATETIME }} + type: cert-manager + uses: ./.github/workflows/integration-test-component.yml + load-tests: name: Load Tests needs: [prepare_ci_run, build_image] diff --git a/.github/workflows/integration-test-component.yml b/.github/workflows/integration-test-component.yml new file mode 100644 index 0000000000..c7b08396a3 --- /dev/null +++ b/.github/workflows/integration-test-component.yml @@ -0,0 +1,57 @@ +name: Integration-Test-Component +on: + workflow_call: + inputs: + runtime_tag: + description: "Tag for the deno and python runner images" + type: "string" + required: true + type: + description: "Type of the tests that are going to be executed" + type: "string" + required: true + +# Declare default permissions as read only. +permissions: read-all + +env: + GO_VERSION: "~1.21" +defaults: + run: + shell: bash + +jobs: + run-integration-test-component: + name: Run Chainsaw Tests + runs-on: ubuntu-22.04 + steps: + - name: Check out code + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Setup cluster + uses: ./.github/actions/deploy-keptn-on-cluster + with: + runtime_tag: ${{ inputs.runtime_tag }} + values-file: values-integration-${{ inputs.type }}.yaml + + - name: Install and expose Prometheus + uses: ./.github/actions/deploy-prometheus-on-cluster + + - name: Install Chainsaw + uses: kyverno/action-install-chainsaw@995cddaee7702e849270b84fa44cdcebe7462da8 # v0.1.9 + + - name: Run Integration Tests ${{ inputs.type }} + working-directory: . + run: make integration-test-${{ inputs.type }} + + - name: Create reports + if: failure() + working-directory: ./.github/scripts + run: ./create-reports-full.sh + + - name: Upload cluster logs + if: failure() + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4 + with: + name: logs-integration-tests-${{ inputs.type }} + path: .github/scripts/logs diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 82c09fca04..2587fe0b8f 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -10,10 +10,6 @@ on: description: "Decides whether to use scheduling gates" type: "string" default: gates_off - allowed-namespaces: - description: "Decides whether to allow only certain namespaces" - type: "string" - default: allowed_ns_off cert-manager-io-enabled: description: "Decides whether to use cert-manager.io" type: "string" @@ -40,8 +36,7 @@ jobs: uses: ./.github/actions/deploy-keptn-on-cluster with: runtime_tag: ${{ inputs.runtime_tag }} - scheduling-gates: ${{ inputs.scheduling-gates }} - allowed-namespaces: ${{ inputs.allowed-namespaces }} + values-file: values-integration-${{ inputs.scheduling-gates }}-${{ inputs.cert-manager-io-enabled }}.yaml cert-manager-io-enabled: ${{ inputs.cert-manager-io-enabled }} - name: Install and expose Prometheus @@ -50,26 +45,10 @@ jobs: - name: Install Chainsaw uses: kyverno/action-install-chainsaw@995cddaee7702e849270b84fa44cdcebe7462da8 # v0.1.9 - - name: Run Scheduling Gates Integration Tests - if: inputs.scheduling-gates == 'gates_on' && inputs.allowed-namespaces == 'allowed_ns_off' - working-directory: . - run: make integration-test-scheduling-gates - - - name: Run Allowed namespaces Integration Tests - if: inputs.allowed-namespaces == 'allowed_ns_on' - working-directory: . - run: make integration-test-allowed-namespaces - - name: Run Integration Tests - if: inputs.allowed-namespaces == 'allowed_ns_off' working-directory: . run: make integration-test - - name: Run Keptn Cert Manager Integration Tests - if: inputs.cert-manager-io-enabled == 'cert_manager_io_off' - working-directory: . - run: make integration-test-cert-manager - - name: Create reports if: failure() working-directory: ./.github/scripts @@ -79,5 +58,5 @@ jobs: if: failure() uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4 with: - name: logs-integration-tests-${{ inputs.scheduling-gates }}-${{ inputs.allowed-namespaces }}-${{ inputs.cert-manager-io-enabled }} + name: logs-integration-tests-${{ inputs.scheduling-gates }}-${{ inputs.cert-manager-io-enabled }} path: .github/scripts/logs diff --git a/.github/workflows/security-scans.yml b/.github/workflows/security-scans.yml index c8a521da57..843980c586 100644 --- a/.github/workflows/security-scans.yml +++ b/.github/workflows/security-scans.yml @@ -140,7 +140,7 @@ jobs: export TAG=$(ls tag/) echo "$TAG" mkdir scans - envsubst < .github/actions/deploy-keptn-on-cluster/values.yaml > tmp.yaml + envsubst < .github/actions/deploy-keptn-on-cluster/values/values.yaml > tmp.yaml echo "used values.yaml file:" cat tmp.yaml diff --git a/Makefile b/Makefile index 0179312146..46c242b223 100644 --- a/Makefile +++ b/Makefile @@ -29,30 +29,40 @@ KUSTOMIZE ?= $(LOCALBIN)/kustomize .PHONY: integration-test #these tests should run on a real cluster! integration-test: kubectl apply -f ./lifecycle-operator/config/crd/bases - chainsaw test --test-dir ./test/chainsaw/testmetrics/ chainsaw test --test-dir ./test/chainsaw/integration/ - chainsaw test --test-dir ./test/chainsaw/testanalysis/ - chainsaw test --test-dir ./test/chainsaw/non-blocking-deployment/ - chainsaw test --test-dir ./test/chainsaw/timeout-failure-deployment/ - chainsaw test --test-dir ./test/chainsaw/traces/ .PHONY: integration-test-local #these tests should run on a real cluster! integration-test-local: kubectl apply -f ./lifecycle-operator/config/crd/bases chainsaw test --test-dir ./test/chainsaw/integration/ --config ./.chainsaw-local.yaml + +.PHONY: integration-test-metrics #these tests should run on a real cluster! +integration-test-metrics: + kubectl apply -f ./lifecycle-operator/config/crd/bases + chainsaw test --test-dir ./test/chainsaw/testmetrics/ + chainsaw test --test-dir ./test/chainsaw/testanalysis/ + +.PHONY: integration-test-metrics-local #these tests should run on a real cluster! +integration-test-metrics-local: + kubectl apply -f ./lifecycle-operator/config/crd/bases chainsaw test --test-dir ./test/chainsaw/testmetrics/ --config ./.chainsaw-local.yaml chainsaw test --test-dir ./test/chainsaw/testanalysis/ --config ./.chainsaw-local.yaml - chainsaw test --test-dir ./test/chainsaw/non-blocking-deployment/ --config ./.chainsaw-local.yaml - chainsaw test --test-dir ./test/chainsaw/timeout-failure-deployment/ --config ./.chainsaw-local.yaml - chainsaw test --test-dir ./test/chainsaw/traces/ --config ./.chainsaw-local.yaml -.PHONY: integration-test-scheduling-gates #these tests should run on a real cluster! -integration-test-scheduling-gates: +.PHONY: integration-test-lifecycle #these tests should run on a real cluster! +integration-test-lifecycle: + kubectl apply -f ./lifecycle-operator/config/crd/bases chainsaw test --test-dir ./test/chainsaw/scheduling-gates/ + chainsaw test --test-dir ./test/chainsaw/non-blocking-deployment/ + chainsaw test --test-dir ./test/chainsaw/timeout-failure-deployment/ + chainsaw test --test-dir ./test/chainsaw/traces/ -.PHONY: integration-test-scheduling-gates-local #these tests should run on a real cluster! -integration-test-scheduling-gates-local: install-prometheus +.PHONY: integration-test-lifecycle-local #these tests should run on a real cluster! +integration-test-lifecycle-local: + kubectl apply -f ./lifecycle-operator/config/crd/bases chainsaw test --test-dir ./test/chainsaw/scheduling-gates/ --config ./.chainsaw-local.yaml + chainsaw test --test-dir ./test/chainsaw/non-blocking-deployment/ --config ./.chainsaw-local.yaml + chainsaw test --test-dir ./test/chainsaw/timeout-failure-deployment/ --config ./.chainsaw-local.yaml + chainsaw test --test-dir ./test/chainsaw/traces/ --config ./.chainsaw-local.yaml .PHONY: integration-test-cert-manager #these tests should run on a real cluster! integration-test-cert-manager: diff --git a/test/chainsaw/testcertificate/cert-recreates/00-assert.yaml b/test/chainsaw/testcertificate/cert-recreates/00-assert.yaml index 4f8a5d1374..65717a44f7 100644 --- a/test/chainsaw/testcertificate/cert-recreates/00-assert.yaml +++ b/test/chainsaw/testcertificate/cert-recreates/00-assert.yaml @@ -7,15 +7,6 @@ metadata: --- apiVersion: apps/v1 kind: Deployment -metadata: - namespace: keptn-system - labels: - control-plane: metrics-operator -status: - readyReplicas: 1 ---- -apiVersion: apps/v1 -kind: Deployment metadata: namespace: keptn-system labels: @@ -31,12 +22,3 @@ metadata: control-plane: lifecycle-operator status: phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - namespace: keptn-system - labels: - control-plane: metrics-operator -status: - phase: Running diff --git a/test/chainsaw/testcertificate/cert-recreates/01-assert.yaml b/test/chainsaw/testcertificate/cert-recreates/01-assert.yaml index 4f8a5d1374..65717a44f7 100644 --- a/test/chainsaw/testcertificate/cert-recreates/01-assert.yaml +++ b/test/chainsaw/testcertificate/cert-recreates/01-assert.yaml @@ -7,15 +7,6 @@ metadata: --- apiVersion: apps/v1 kind: Deployment -metadata: - namespace: keptn-system - labels: - control-plane: metrics-operator -status: - readyReplicas: 1 ---- -apiVersion: apps/v1 -kind: Deployment metadata: namespace: keptn-system labels: @@ -31,12 +22,3 @@ metadata: control-plane: lifecycle-operator status: phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - namespace: keptn-system - labels: - control-plane: metrics-operator -status: - phase: Running diff --git a/test/chainsaw/testcertificate/cert-recreates/02-assert.yaml b/test/chainsaw/testcertificate/cert-recreates/02-assert.yaml index 1ffdaf9b05..35f6fa2609 100644 --- a/test/chainsaw/testcertificate/cert-recreates/02-assert.yaml +++ b/test/chainsaw/testcertificate/cert-recreates/02-assert.yaml @@ -9,15 +9,6 @@ metadata: --- apiVersion: apps/v1 kind: Deployment -metadata: - labels: - control-plane: metrics-operator - namespace: keptn-system -status: - readyReplicas: 1 ---- -apiVersion: apps/v1 -kind: Deployment metadata: labels: control-plane: lifecycle-operator @@ -33,12 +24,3 @@ metadata: control-plane: lifecycle-operator status: phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - namespace: keptn-system - labels: - control-plane: metrics-operator -status: - phase: Running diff --git a/test/chainsaw/testcertificate/cert-recreates/chainsaw-test.yaml b/test/chainsaw/testcertificate/cert-recreates/chainsaw-test.yaml index 08d08d0694..02f4282222 100755 --- a/test/chainsaw/testcertificate/cert-recreates/chainsaw-test.yaml +++ b/test/chainsaw/testcertificate/cert-recreates/chainsaw-test.yaml @@ -18,7 +18,6 @@ spec: content: | set -e kubectl rollout restart deployment -n keptn-system -l control-plane=lifecycle-operator - kubectl rollout restart deployment -n keptn-system -l control-plane=metrics-operator - assert: file: 00-assert.yaml - name: step-01 diff --git a/test/chainsaw/testmetrics/metrics-provider/logs.sh b/test/chainsaw/testmetrics/metrics-provider/logs.sh index 5674082879..4084d286b2 100755 --- a/test/chainsaw/testmetrics/metrics-provider/logs.sh +++ b/test/chainsaw/testmetrics/metrics-provider/logs.sh @@ -5,7 +5,7 @@ RETRY_COUNT=3 SLEEP_TIME=5 for i in $(seq 1 $RETRY_COUNT); do - VAR=$(kubectl logs -n $NAMESPACE deployments/lifecycle-operator | grep -c "Error while parsing response") + VAR=$(kubectl logs -n $NAMESPACE deployments/metrics-operator | grep -c "Error while parsing response") # shellcheck disable=SC1072 if [ "$VAR" -ge 1 ]; then echo "Controller could access secret" diff --git a/test/chainsaw/testmetrics/metrics/chainsaw-test.yaml b/test/chainsaw/testmetrics/metrics/chainsaw-test.yaml index 45c0ef9034..226caefccf 100755 --- a/test/chainsaw/testmetrics/metrics/chainsaw-test.yaml +++ b/test/chainsaw/testmetrics/metrics/chainsaw-test.yaml @@ -49,18 +49,3 @@ spec: # yamllint enable rule:line-length check: (contains($stdout, '1')): true - - name: step-04 - try: - - script: - content: | - kubectl port-forward svc/lifecycle-operator-metrics-service -n keptn-system 2222 > /dev/null 2>&1 & - port_forward_pid=$! - # trap to kill the port-forward process on script exit - trap 'kill $port_forward_pid' EXIT - # Wait for the port-forward process to complete - sleep 10 - curl -s "http://localhost:2222/metrics" | grep "keptn_lifecycle_active_total" - timeout: 40s - check: - # This checks that Keptn returns active metrics - (contains($stdout, 'keptn_lifecycle_active_total')): true