Skip to content

Commit 76eae50

Browse files
committed
[ci] Converge tests based on enabled features
1 parent 1337609 commit 76eae50

File tree

3 files changed

+97
-4
lines changed

3 files changed

+97
-4
lines changed

.zuul.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/telemetry-operator'].src_dir }}/ci/vars-autoscaling.yml"
1313
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/telemetry-operator'].src_dir }}/ci/vars-power-monitoring.yml"
1414
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/telemetry-operator'].src_dir }}/ci/vars-autoscaling-tempest.yml"
15-
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/vars-functional-test.yml"
15+
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/vars-fvt-tests.yml"
1616
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/vars-use-master-containers.yml"
1717
roles:
1818
- zuul: github.com/openstack-k8s-operators/ci-framework
@@ -69,7 +69,7 @@
6969
# Use the tempest config we have for autoscaling tests
7070
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/telemetry-operator'].src_dir }}/ci/vars-autoscaling-tempest.yml"
7171
# There's an override in here to modify the enabled tests to include only the smoke tests
72-
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/vars-logging-test.yml"
72+
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/vars-fvt-tests.yml"
7373
roles:
7474
- zuul: github.com/openstack-k8s-operators/ci-framework
7575
required-projects: *required_projects
@@ -102,8 +102,7 @@
102102
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/telemetry-operator'].src_dir }}/ci/vars-power-monitoring.yml"
103103
# Use the tempest config we have for autoscaling tests
104104
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/telemetry-operator'].src_dir }}/ci/vars-autoscaling-tempest.yml"
105-
# Currently, this runs tempest smoketests after the dashboards have been disabled again
106-
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/vars-graphing-test.yml"
105+
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/vars-fvt-tests.yml"
107106
roles:
108107
- zuul: github.com/openstack-k8s-operators/ci-framework
109108
required-projects: *required_projects

ci/run_fvt_tests.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
- name: Run FVT tests on osp18
3+
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
4+
gather_facts: true
5+
environment:
6+
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
7+
PATH: "{{ cifmw_path }}"
8+
vars_files:
9+
- vars/common.yml
10+
tasks:
11+
- name: Autoscaling test
12+
block:
13+
- name: "Get OpenStackControlPlane autoscaling status"
14+
ansible.builtin.command: >
15+
oc get oscp -n openstack -o jsonpath='{.items[0].spec.telemetry.template.autoscaling.enabled}'
16+
register: autoscaling_status
17+
changed_when: false
18+
19+
- name: "Set fact if autoscaling is enabled"
20+
set_fact:
21+
enable_autoscaling_role: "{{ autoscaling_status.stdout | trim | lower == 'true' }}"
22+
23+
- name: "Skip autoscaling tests because autoscaling is not enabled"
24+
ansible.builtin.debug:
25+
msg: "Skipping autoscaling tests because OpenStackControlPlane telemetry autoscaling is not enabled."
26+
when: not enable_autoscaling_role | bool
27+
28+
- name: Graphing test
29+
block:
30+
- name: "Get OpenStackControlPlane telemetry dashboardsEnabled status"
31+
ansible.builtin.command: >
32+
oc get oscp -n openstack -o jsonpath='{.items[0].spec.telemetry.template.metricStorage.dashboardsEnabled}'
33+
register: dashboard_status
34+
changed_when: false
35+
36+
- name: "Set fact if dashboards are enabled"
37+
set_fact:
38+
enable_graphing_role: "{{ dashboard_status.stdout | trim | lower == 'true' }}"
39+
40+
- name: "Skip graphing test because dashboards are not enabled"
41+
ansible.builtin.debug:
42+
msg: "Skipping graphing test because OpenStackControlPlane telemetry dashboards are not enabled."
43+
when: not enable_graphing_role | bool
44+
45+
- name: Logging test
46+
block:
47+
- name: "Get OpenStackControlPlane telemetry logging status"
48+
ansible.builtin.command: >
49+
oc get oscp -n openstack -o jsonpath='{.items[0].spec.telemetry.template.logging.enabled}'
50+
register: logging_status
51+
changed_when: false
52+
53+
- name: "Set fact if logging is enabled"
54+
set_fact:
55+
enable_logging_role: "{{ logging_status.stdout | trim | lower == 'true' }}"
56+
57+
- name: "Skip logging tests because logging is not enabled"
58+
ansible.builtin.debug:
59+
msg: "Skipping logging tests because OpenStackControlPlane telemetry logging is not enabled."
60+
when: not enable_logging_role | bool
61+
62+
- name: Run Autoscaling test
63+
ansible.builtin.import_playbook: run_cloudops_tests_osp18.yml
64+
when: enable_autoscaling_role | bool
65+
66+
- name: Run Graphing Console UI test
67+
ansible.builtin.import_playbook: run_graphing_test.yml
68+
when: enable_graphing_role | bool
69+
70+
- name: Run Logging test on dataplane
71+
ansible.builtin.import_playbook: logging_tests_computes.yml
72+
when: enable_logging_role | bool
73+
74+
- name: Run Logging test on controlplane
75+
ansible.builtin.import_playbook: logging_tests_controller.yml
76+
when: enable_logging_role | bool

ci/vars-fvt-tests.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
post_deploy_00_run_fvt_tests:
3+
source: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/run_fvt_tests.yml"
4+
config_file: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/ansible.cfg"
5+
type: playbook
6+
post_deploy_01_copy_results:
7+
source: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/report_result.yml"
8+
type: playbook
9+
extra_vars:
10+
check_failures: false
11+
12+
cifmw_run_tests: true
13+
# run only smoke tests
14+
cifmw_test_operator_tempest_include_list: |
15+
^tempest.*\[.*\bsmoke\b.*\]
16+
post_tests_99_collect_results:
17+
source: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/report_result.yml"
18+
type: playbook

0 commit comments

Comments
 (0)