Skip to content

Commit

Permalink
chore: optimize integration tests pipeline with scheduling gates (#2191)
Browse files Browse the repository at this point in the history
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
  • Loading branch information
odubajDT committed Sep 28, 2023
1 parent 761b38f commit ac85d0d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 44 deletions.
6 changes: 3 additions & 3 deletions .github/actions/deploy-klt-on-cluster/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ inputs:
required: false
description: "Install Keptn via helm instead of manifest if true"
default: "true"
scheduling_gates:
scheduling-gates:
required: false
description: "Use scheduling gates instead of scheduler"
default: "false"
Expand Down Expand Up @@ -61,7 +61,7 @@ runs:
done
- name: Install lifecycle-toolkit with manifests
if: inputs.helm-install == 'false' && inputs.scheduling_gates == 'false'
if: inputs.helm-install == 'false' && inputs.scheduling-gates == 'false'
shell: bash
run: |
echo "Installing Keptn using manifests"
Expand Down Expand Up @@ -95,7 +95,7 @@ runs:
echo "Installing Keptn using helm"
helm version
helm install -n keptn-lifecycle-toolkit-system --create-namespace toolkit ./helm/chart \
--set schedulingGatesEnabled=${{ inputs.scheduling_gates }} \
--set schedulingGatesEnabled=${{ inputs.scheduling-gates }} \
--set scheduler.scheduler.imagePullPolicy=Never \
--set scheduler.scheduler.image.tag=${{ inputs.runtime_tag }} \
--set scheduler.scheduler.image.repository="localhost:5000/keptn/scheduler" \
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,15 @@ jobs:
strategy:
matrix:
helm: [true, false]
scheduling-gates: [true, false]
# do not run the tests with manifests installation and scheduling gates
exclude:
- helm: false
scheduling-gates: true
with:
runtime_tag: dev-${{ needs.prepare_ci_run.outputs.DATETIME }}
helm-install: ${{ matrix.helm }}
scheduling-gates: ${{ matrix.scheduling-gates }}
uses: ./.github/workflows/integration-test.yml

load-tests:
Expand Down
51 changes: 10 additions & 41 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
description: "Decides whether to install via helm"
type: "boolean"
default: true
scheduling-gates:
description: "Decides whether to ue scheduling gates"
type: "boolean"
default: false
env:
GO_VERSION: "~1.20"
# renovate: datasource=github-tags depName=kudobuilder/kuttl
Expand All @@ -31,6 +35,7 @@ jobs:
with:
runtime_tag: ${{ inputs.runtime_tag }}
helm-install: ${{ inputs.helm-install }}
scheduling-gates: ${{ inputs.scheduling-gates }}

- name: Install and expose Prometheus
uses: ./.github/actions/deploy-prometheus-on-cluster
Expand All @@ -43,50 +48,14 @@ jobs:
chmod +x kubectl-kuttl
mv kubectl-kuttl /usr/local/bin
- name: Run Integration Tests
- name: Run Scheduling Gates Integration Tests
if: inputs.scheduling-gates == true
working-directory: .
run: make integration-test

- name: Create reports
if: always()
working-directory: ./.github/scripts
run: ./create-reports-full.sh

- name: Upload cluster logs
if: always()
uses: actions/upload-artifact@v3
with:
name: logs-integration-tests-${{ inputs.helm-install }}
path: .github/scripts/logs

run-integration-test-scheduling-gates:
name: Run Integration Tests Scheduling Gates
if: ${{ inputs.helm-install == true }}
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Setup cluster
uses: ./.github/actions/deploy-klt-on-cluster
with:
runtime_tag: ${{ inputs.runtime_tag }}
scheduling_gates: "true"

- name: Install and expose Prometheus
uses: ./.github/actions/deploy-prometheus-on-cluster

- name: Download KUTTL
env:
BASE_URL: "https://github.com/kudobuilder/kuttl/releases"
run: |
curl -fL "${BASE_URL}/download/${{ env.KUTTL_VERSION }}/kubectl-kuttl_${KUTTL_VERSION#v}_linux_x86_64" -o kubectl-kuttl
chmod +x kubectl-kuttl
mv kubectl-kuttl /usr/local/bin
run: make integration-test-scheduling-gates

- name: Run Integration Tests
working-directory: .
run: make integration-test-scheduling-gates && make integration-test
run: make integration-test

- name: Create reports
if: always()
Expand All @@ -97,5 +66,5 @@ jobs:
if: always()
uses: actions/upload-artifact@v3
with:
name: logs-integration-tests-scheduling-gates
name: logs-integration-tests-helm_${{ inputs.helm-install }}-schedule_${{ inputs.scheduling-gates }}
path: .github/scripts/logs

0 comments on commit ac85d0d

Please sign in to comment.