Skip to content

Commit f878b1c

Browse files
committed
Add hooks before running kuttl from operator target
Add a hook to run before calling the kuttl tests in the job variant that runs them from the operator target (wihtout using install_yamls).
1 parent f4603a7 commit f878b1c

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

ci/playbooks/kuttl/deploy-deps.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@
9999
name: 'install_yamls_makes'
100100
tasks_from: 'make_openstack_init'
101101

102+
- name: Run hooks after installing openstack
103+
vars:
104+
step: post_install_operators_kuttl_from_operator
105+
ansible.builtin.include_role:
106+
name: run_hook
107+
102108
- name: install kuttl test_suite dependencies
103109
vars:
104110
project_name: "github.com/openstack-k8s-operators/{{ operator_name }}"

ci/playbooks/kuttl/run-kuttl-from-operator-targets.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
}}
88
kuttl_log_dir: "{{ local_log_dir | default(ansible_user_dir + '/zuul-output/logs/controller') }}"
99
tasks:
10+
- name: Run hooks before running kuttl tests
11+
vars:
12+
step: pre_kuttl_from_operator
13+
ansible.builtin.include_role:
14+
name: run_hook
15+
1016
- name: run kuttl test suite from operator Makefile
1117
environment:
1218
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"

docs/source/usage/01_usage.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ If you want to list multiple hooks, you have to use the following parameter name
123123
- `post_admin_setup`: before admin setup
124124
- `pre_tests`: before running tests
125125
- `post_tests`: after running tests
126+
- `post_install_operators_kuttl_from_operator`: after installing openstack operator for kuttl test when calling them from the operator's make target
127+
- `pre_kuttl_from_operator`: before running kuttl test when calling them from
128+
the operator's make target
126129

127130
Since we're already providing hooks as list, you may want to just add one or two hooks
128131
using your own environment file. Parameter structure is simple: `PREFIX_HOOKNAME: {hook struct}`

0 commit comments

Comments
 (0)