Add additional single tests + upgrade test

This commit is contained in:
Matt Pryor 2023-06-19 10:21:48 +01:00
parent 04d550899b
commit dbffce4798
3 changed files with 61 additions and 149 deletions

View File

@ -30,6 +30,10 @@ inputs:
description: Specify "full" to do a full Sonobuoy run, anything else runs a smoke test only description: Specify "full" to do a full Sonobuoy run, anything else runs a smoke test only
required: true required: true
default: smoke default: smoke
sonobuoy-upload:
description: Specify "yes" to upload the Sonobuoy run as an artifact
required: true
default: "no"
runs: runs:
using: "composite" using: "composite"
@ -96,23 +100,25 @@ runs:
run: sonobuoy run --mode quick --wait run: sonobuoy run --mode quick --wait
env: env:
KUBECONFIG: ./kubeconfig KUBECONFIG: ./kubeconfig
if: "${{ inputs.sonobuoy-full != 'full' }}" if: "${{ inputs.sonobuoy-mode != 'full' }}"
- name: Run sonobuoy [full] - name: Run sonobuoy [full]
shell: bash shell: bash
run: sonobuoy run --wait run: sonobuoy run --wait
env: env:
KUBECONFIG: ./kubeconfig KUBECONFIG: ./kubeconfig
if: "${{ inputs.sonobuoy-full == 'full' }}" if: "${{ inputs.sonobuoy-mode == 'full' }}"
- name: Retrieve sonobuoy results - name: Retrieve sonobuoy results
shell: bash shell: bash
run: ./scripts/sonobuoy-retrieve.sh --filename ./sonobuoy-results-${{ inputs.name }}.tar.gz run: ./scripts/sonobuoy-retrieve.sh --filename ./sonobuoy-results-${{ inputs.name }}.tar.gz
env: env:
KUBECONFIG: ./kubeconfig KUBECONFIG: ./kubeconfig
if: "${{ inputs.sonobuoy-upload == 'yes' }}"
- name: Upload sonobuoy results artifact - name: Upload sonobuoy results artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: sonobuoy-results-${{ inputs.name }} name: sonobuoy-results-${{ inputs.name }}
path: ./sonobuoy-results-${{ inputs.name }}.tar.gz path: ./sonobuoy-results-${{ inputs.name }}.tar.gz
if: "${{ inputs.sonobuoy-upload == 'yes' }}"

View File

@ -2,10 +2,6 @@ name: Ensure CAPI images
on: on:
workflow_call: workflow_call:
outputs: outputs:
kube-1-24-image:
value: ${{ jobs.ensure-capi-images.outputs.kube-1-24-image }}
kube-1-24-version:
value: ${{ jobs.ensure-capi-images.outputs.kube-1-24-version }}
kube-1-25-image: kube-1-25-image:
value: ${{ jobs.ensure-capi-images.outputs.kube-1-25-image }} value: ${{ jobs.ensure-capi-images.outputs.kube-1-25-image }}
kube-1-25-version: kube-1-25-version:
@ -24,8 +20,6 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
# We output the image IDs for each image # We output the image IDs for each image
outputs: outputs:
kube-1-24-image: ${{ steps.kube-1-24.outputs.image-id }}
kube-1-24-version: 1.24.14
kube-1-25-image: ${{ steps.kube-1-25.outputs.image-id }} kube-1-25-image: ${{ steps.kube-1-25.outputs.image-id }}
kube-1-25-version: 1.25.10 kube-1-25-version: 1.25.10
kube-1-26-image: ${{ steps.kube-1-26.outputs.image-id }} kube-1-26-image: ${{ steps.kube-1-26.outputs.image-id }}
@ -51,13 +45,6 @@ jobs:
- name: Install OpenStack CLI - name: Install OpenStack CLI
run: pip install python-openstackclient run: pip install python-openstackclient
- name: Ensure Kubernetes 1.24 image
id: kube-1-24
uses: ./.github/actions/ensure-image
with:
image-name: ubuntu-focal-kube-v1.24.14-230602-1702
if: ${{ !github.event.pull_request.draft }}
- name: Ensure Kubernetes 1.25 image - name: Ensure Kubernetes 1.25 image
id: kube-1-25 id: kube-1-25
uses: ./.github/actions/ensure-image uses: ./.github/actions/ensure-image

View File

@ -159,153 +159,72 @@ jobs:
machineFlavor: vm.ska.cpu.general.small machineFlavor: vm.ska.cpu.general.small
name: test-group1 name: test-group1
- name: Test clean Kubernetes 1.24 deployment - name: Test clean Kubernetes 1.25 deployment
uses: ./.github/actions/upgrade-and-test uses: ./.github/actions/upgrade-and-test
with: with:
name: ci-${{ github.run_id }}-kube-1-24 name: ci-${{ github.run_id }}-kube-1-25
kubernetes-version: ${{ fromJson(inputs.images).kube-1-24-version }} kubernetes-version: ${{ fromJson(inputs.images).kube-1-25-version }}
image-id: ${{ fromJson(inputs.images).kube-1-24-image }} image-id: ${{ fromJson(inputs.images).kube-1-25-image }}
sonobuoy-upload: "yes"
if: ${{ !github.event.pull_request.draft }} if: ${{ !github.event.pull_request.draft }}
- name: Delete Kubernetes 1.24 deployment - name: Delete Kubernetes 1.25 deployment
run: helm delete ci-${{ github.run_id }}-kube-1-24 --wait run: helm delete ci-${{ github.run_id }}-kube-1-25 --wait
if: ${{ always() }} if: ${{ always() }}
# Not sure about this - name: Test clean Kubernetes 1.26 deployment
# It has potential to expose secrets in the stdout of the GitHub Actions uses: ./.github/actions/upgrade-and-test
# - name: Template cluster with:
# run: |- name: ci-${{ github.run_id }}-kube-1-26
# helm template ci-${{ github.run_id }}-${{ inputs.name }} ./charts/openstack-cluster \ kubernetes-version: ${{ fromJson(inputs.images).kube-1-26-version }}
# --dependency-update \ image-id: ${{ fromJson(inputs.images).kube-1-26-image }}
# --values clouds.yml \ sonobuoy-upload: "yes"
# --values values-common.yaml \ if: ${{ !github.event.pull_request.draft }}
# --set kubernetesVersion=${{ inputs.version }} \
# --set machineImageId=${{ inputs.image }} \
# --debug
# - name: Create cluster - name: Delete Kubernetes 1.26 deployment
# run: |- run: helm delete ci-${{ github.run_id }}-kube-1-26 --wait
# helm upgrade ci-${{ github.run_id }}-${{ inputs.name }} ./charts/openstack-cluster \ if: ${{ always() }}
# --install \
# --dependency-update \
# --values clouds.yml \
# --values values-common.yaml \
# --set kubernetesVersion=${{ inputs.version }} \
# --set machineImageId=${{ inputs.image }}
# - name: Wait for cluster READY - name: Test clean Kubernetes 1.27 deployment
# run: |- uses: ./.github/actions/upgrade-and-test
# kubectl wait clusters.cluster.x-k8s.io/ci-${{ github.run_id }}-${{ inputs.name }} \ with:
# --for=condition=Ready \ name: ci-${{ github.run_id }}-kube-1-27
# --timeout 30m kubernetes-version: ${{ fromJson(inputs.images).kube-1-27-version }}
image-id: ${{ fromJson(inputs.images).kube-1-27-image }}
sonobuoy-mode: "${{ github.event.pull_request.draft && 'smoke' || 'full' }}"
sonobuoy-upload: "yes"
# - name: Wait for addons to deploy - name: Delete Kubernetes 1.27 deployment
# run: |- run: helm delete ci-${{ github.run_id }}-kube-1-27 --wait
# kubectl wait manifests \ if: ${{ always() }}
# --all \
# --for=jsonpath='{.status.phase}'=Deployed \
# --timeout 20m \
# && \
# kubectl wait helmreleases \
# --all \
# --for=jsonpath='{.status.phase}'=Deployed \
# --timeout 20m
# - name: Write kubeconfig - name: Deploy Kubernetes 1.25 for upgrade test
# run: |- uses: ./.github/actions/upgrade-and-test
# kubectl get secret ci-${{ github.run_id }}-${{ inputs.name }}-kubeconfig \ with:
# -o go-template='{{ .data.value | base64decode }}' \ name: ci-${{ github.run_id }}-upgrade
# > kubeconfig kubernetes-version: ${{ fromJson(inputs.images).kube-1-25-version }}
image-id: ${{ fromJson(inputs.images).kube-1-25-image }}
if: ${{ !github.event.pull_request.draft }}
# - name: Wait for dns pods - name: Upgrade to Kubernetes 1.26
# run: |- uses: ./.github/actions/upgrade-and-test
# kubectl wait po \ with:
# --namespace kube-system \ name: ci-${{ github.run_id }}-upgrade
# --selector k8s-app=kube-dns \ kubernetes-version: ${{ fromJson(inputs.images).kube-1-26-version }}
# --for=condition=ready \ image-id: ${{ fromJson(inputs.images).kube-1-26-image }}
# --timeout 20m if: ${{ !github.event.pull_request.draft }}
# env:
# KUBECONFIG: ./kubeconfig
# - name: Run sonobuoy [smoke] - name: Upgrade to Kubernetes 1.27
# timeout-minutes: 20 uses: ./.github/actions/upgrade-and-test
# run: sonobuoy run --mode quick --wait with:
# env: name: ci-${{ github.run_id }}-upgrade
# KUBECONFIG: ./kubeconfig kubernetes-version: ${{ fromJson(inputs.images).kube-1-27-version }}
# if: "${{ inputs.upgrade-image != '' }}" image-id: ${{ fromJson(inputs.images).kube-1-27-image }}
if: ${{ !github.event.pull_request.draft }}
# - name: Clean sonobuoy - name: Delete upgrade deployment
# run: sonobuoy delete --wait --all run: helm delete ci-${{ github.run_id }}-upgrade --wait
# env: if: ${{ always() }}
# KUBECONFIG: ./kubeconfig
# if: "${{ inputs.upgrade-image != '' }}"
# - name: Upgrade cluster
# run: |-
# helm upgrade ci-${{ github.run_id }}-${{ inputs.name }} ./charts/openstack-cluster \
# --install \
# --dependency-update \
# --values clouds.yml \
# --values values-common.yaml \
# --set kubernetesVersion=${{ inputs.upgrade-version }} \
# --set machineImageId=${{ inputs.upgrade-image }}
# if: "${{ inputs.upgrade-image != '' }}"
# - name: Wait for cluster NOT READY
# run: sleep 3m
# if: "${{ inputs.upgrade-image != '' }}"
# - name: Wait for cluster READY
# run: |-
# kubectl wait clusters.cluster.x-k8s.io/ci-${{ github.run_id }}-${{ inputs.name }} \
# --for=condition=Ready \
# --timeout 30m
# if: "${{ inputs.upgrade-image != '' }}"
# - name: Wait for addons to deploy
# run: |-
# kubectl wait manifests \
# --all \
# --for=jsonpath='{.status.phase}'=Deployed \
# --timeout 20m \
# && \
# kubectl wait helmreleases \
# --all \
# --for=jsonpath='{.status.phase}'=Deployed \
# --timeout 20m
# if: "${{ inputs.upgrade-image != '' }}"
# - name: Run sonobuoy [smoke]
# timeout-minutes: 20
# run: sonobuoy run --mode quick --wait
# env:
# KUBECONFIG: ./kubeconfig
# if: ${{ !inputs.sonobuoy-full }}
# - name: Run sonobuoy [full]
# timeout-minutes: 120
# run: sonobuoy run --wait
# env:
# KUBECONFIG: ./kubeconfig
# if: ${{ inputs.sonobuoy-full }}
# - name: Retrieve sonobuoy results
# continue-on-error: true
# env:
# KUBECONFIG: ./kubeconfig
# STATUS_INTERVAL_SEC: 20
# run: ./scripts/sonobuoy-artifacts.sh
# - name: Upload sonobuoy log artifacts
# uses: actions/upload-artifact@v3
# if: ${{ always() }}
# with:
# name: sonobuoy-logs-${{ inputs.name }}
# path: ./results.txt
# - name: Delete release
# if: ${{ always() }}
# run: helm delete ci-${{ github.run_id }}-${{ inputs.name }} --wait
- name: Output controller logs - name: Output controller logs
if: ${{ always() }} if: ${{ always() }}