test: Restructure zuul-operator-functional-k8s layout
This change is a precursor to introducing a Helm-based functional test so that we can also exercise the Helm charts. It consists of the following: (1) the template install is factored out as a distinct pre-run step so as to enable us to swap it out later (2) the kubernetes node setup is moved to pre-k8s.yaml so that it happens before we attempt to install the operator to make it re-usable in the subsequent Helm-based test Change-Id: I16d0ceda8446f18038e318b8503fa49388c95d97
This commit is contained in:
parent
391ac1d25a
commit
c2947e607b
|
@ -17,7 +17,9 @@
|
||||||
description: Operator integration tests with Kubernetes
|
description: Operator integration tests with Kubernetes
|
||||||
name: zuul-operator-functional-k8s
|
name: zuul-operator-functional-k8s
|
||||||
parent: zuul-operator-functional
|
parent: zuul-operator-functional
|
||||||
pre-run: playbooks/zuul-operator-functional/pre-k8s.yaml
|
pre-run:
|
||||||
|
- playbooks/zuul-operator-functional/pre-k8s.yaml
|
||||||
|
- playbooks/zuul-operator-functional/install_templates.yaml
|
||||||
nodeset: ubuntu-bionic
|
nodeset: ubuntu-bionic
|
||||||
vars:
|
vars:
|
||||||
namespace: 'default'
|
namespace: 'default'
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
- name: install and start zuul operator
|
||||||
|
hosts: all
|
||||||
|
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: Setup CRD
|
||||||
|
command: kubectl apply -f deploy/crds/zuul-ci_v1alpha2_zuul_crd.yaml -f deploy/rbac.yaml
|
||||||
|
args:
|
||||||
|
chdir: "{{ zuul_work_dir }}"
|
||||||
|
|
||||||
|
- name: Install operator
|
||||||
|
when: install_operator
|
||||||
|
command: kubectl apply -f deploy/operator.yaml
|
||||||
|
args:
|
||||||
|
chdir: "{{ zuul_work_dir }}"
|
||||||
|
|
||||||
|
- name: Wait for operator deployment
|
||||||
|
when: install_operator
|
||||||
|
command: timeout 8m kubectl rollout status deployment/zuul-operator
|
|
@ -1,5 +1,8 @@
|
||||||
- name: start kubernetes and install all dependencies
|
- name: start kubernetes and install all dependencies
|
||||||
hosts: all
|
hosts: all
|
||||||
|
vars:
|
||||||
|
runtime: minikube
|
||||||
|
zuul_work_dir: "{{ zuul.projects['opendev.org/zuul/zuul-operator'].src_dir }}"
|
||||||
roles:
|
roles:
|
||||||
- role: clear-firewall
|
- role: clear-firewall
|
||||||
- role: ensure-pip
|
- role: ensure-pip
|
||||||
|
@ -28,3 +31,7 @@
|
||||||
until: _api_ready.rc == 0
|
until: _api_ready.rc == 0
|
||||||
retries: 6
|
retries: 6
|
||||||
delay: 10
|
delay: 10
|
||||||
|
|
||||||
|
- name: Create static node
|
||||||
|
include_tasks: ./tasks/create_static_node.yaml
|
||||||
|
|
||||||
|
|
|
@ -1,33 +1,9 @@
|
||||||
- name: install and start zuul operator
|
- name: install and start zuul operator
|
||||||
hosts: all
|
hosts: all
|
||||||
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 }}"
|
|
||||||
runtime: minikube
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Setup CRD
|
|
||||||
command: kubectl apply -f deploy/crds/zuul-ci_v1alpha2_zuul_crd.yaml -f deploy/rbac.yaml
|
|
||||||
args:
|
|
||||||
chdir: "{{ zuul_work_dir }}"
|
|
||||||
|
|
||||||
- name: Install operator
|
|
||||||
when: install_operator
|
|
||||||
command: kubectl apply -f deploy/operator.yaml
|
|
||||||
args:
|
|
||||||
chdir: "{{ zuul_work_dir }}"
|
|
||||||
|
|
||||||
- name: Create static node
|
|
||||||
include_tasks: ./tasks/create_static_node.yaml
|
|
||||||
|
|
||||||
- name: Create required secret
|
- name: Create required secret
|
||||||
include_tasks: ./tasks/create_test_secrets.yaml
|
include_tasks: ./tasks/create_test_secrets.yaml
|
||||||
|
|
||||||
- name: Wait for operator deployment
|
|
||||||
when: install_operator
|
|
||||||
command: timeout 8m kubectl rollout status deployment/zuul-operator
|
|
||||||
|
|
||||||
- name: Deploy CR
|
- name: Deploy CR
|
||||||
include_tasks: tasks/apply_cr.yaml
|
include_tasks: tasks/apply_cr.yaml
|
||||||
vars:
|
vars:
|
||||||
|
|
Loading…
Reference in New Issue