From 7909c7d1a9a26586a5d8a4ca6d43c3a8d73e067f Mon Sep 17 00:00:00 2001 From: Michael Kelly Date: Mon, 28 Nov 2022 22:50:05 -0800 Subject: [PATCH] test: Introduce Helm-based functional test This change introduces an operator functional test that is related to the existing template-based functional test (and indeed re-uses most elements of it). The primary differences are: (1) we do the install using helm (2) the operator deployment derives its name from the helm app name This test also configure the helm chart such that the PXC operator and cert-manager are installed as this an underlying requirement of the test. Change-Id: Ibd8add5fffbe8bff798ccffebfb3c0c5eb17f619 --- .zuul.yaml | 25 ++++++++++++++++--- .../install_helm.yaml | 21 ++++++++++++++++ 2 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 playbooks/zuul-operator-functional/install_helm.yaml diff --git a/.zuul.yaml b/.zuul.yaml index 92eef5a..2b76e9d 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -16,14 +16,29 @@ - job: description: Operator integration tests with Kubernetes name: zuul-operator-functional-k8s + abstract: true parent: zuul-operator-functional pre-run: - playbooks/zuul-operator-functional/pre-k8s.yaml - - playbooks/zuul-operator-functional/install_templates.yaml nodeset: ubuntu-bionic vars: namespace: 'default' +- job: + description: Operator integration tests with Kubernetes using templates + name: zuul-operator-functional-k8s-template + parent: zuul-operator-functional-k8s + pre-run: + - playbooks/zuul-operator-functional/install_templates.yaml + +- job: + description: Operation integration tests with Kubernetes using helm + name: zuul-operator-functional-k8s-helm + parent: zuul-operator-functional-k8s + pre-run: + - playbooks/zuul-operator-functional/pre-k8s.yaml + - playbooks/zuul-operator-functional/install_helm.yaml + - job: description: Image and buildset registry job name: zuul-operator-build-image @@ -113,7 +128,9 @@ - zuul-nox-docs - zuul-operator-helm-lint - zuul-operator-build-image - - zuul-operator-functional-k8s: + - zuul-operator-functional-k8s-template: + dependencies: zuul-operator-build-image + - zuul-operator-functional-k8s-helm: dependencies: zuul-operator-build-image gate: jobs: @@ -121,8 +138,10 @@ - zuul-nox-docs - zuul-operator-helm-lint - zuul-operator-upload-image - - zuul-operator-functional-k8s: + - zuul-operator-functional-k8s-template: dependencies: zuul-operator-upload-image + - zuul-operator-functional-k8s-helm: + dependencies: zuul-operator-build-image promote: jobs: - zuul-promote-nox-docs diff --git a/playbooks/zuul-operator-functional/install_helm.yaml b/playbooks/zuul-operator-functional/install_helm.yaml new file mode 100644 index 0000000..2bf126d --- /dev/null +++ b/playbooks/zuul-operator-functional/install_helm.yaml @@ -0,0 +1,21 @@ +- name: install and start zuul operator + hosts: all + roles: + - role: ensure-helm + vars: + helm_version: 3.10.1 + vars: + # Override this if you are running the operator interactively + # locally for development. + install_operator: true + zuul_work_dir: "{{ zuul.projects['opendev.org/zuul/zuul-operator'].src_dir }}" + tasks: + - name: Install Operator + when: install_operator + command: helm install --set image.tag=latest,cert-manager.enabled=true,pxc-operator.enabled=true test helm/zuul-operator + args: + chdir: "{{ zuul_work_dir }}" + + - name: Wait for operator deployment + when: install_operator + command: timeout 8m kubectl rollout status deployment/test-zuul-operator