Skip to content

Commit

Permalink
Add to irrelevant_files list for graphing, logging
Browse files Browse the repository at this point in the history
and autoscaling jobs
  • Loading branch information
ayefimov-1 committed Feb 3, 2025
1 parent e846964 commit 4dbf191
Show file tree
Hide file tree
Showing 27 changed files with 262 additions and 99 deletions.
1 change: 1 addition & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ skip_list:
- command-instead-of-module # Using command rather than module
- galaxy
- meta-no-info # meta/main.yml should contain relevant info
- name[template] # Jinja templates should only be at the end of 'name'
- risky-shell-pipe # Shells that use pipes should set the pipefail option
- unnamed-task # All tasks should be named
- var-naming[no-role-prefix] # Variables names from within roles should use role_name_ as a prefix
Expand Down
67 changes: 56 additions & 11 deletions .zuul.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/ci-framework'].src_dir }}/scenarios/centos-9/multinode-ci.yml"
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/telemetry-operator'].src_dir }}/ci/vars-autoscaling.yml"
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/vars-functional-test.yml"
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/vars-use-master-containers.yml"
roles:
- zuul: github.com/openstack-k8s-operators/ci-framework
required-projects: &required_projects
Expand Down Expand Up @@ -57,11 +58,26 @@
roles:
- zuul: github.com/openstack-k8s-operators/ci-framework
required-projects: *required_projects
irrelevant-files:
<<: *irrelevant_files
- roles/telemetry_graphing
- roles/telemetry_autoscaling
- roles/telemetry_verify_metrics
irrelevant-files:
# *irrelevant_files
- .github/.*
- ci/github/.*
- callback_plugins/.*
- README*
- .*/*.md
- roles/client_side_tests/.*
- roles/test_alerts/.*
- roles/test_collectd/.*
- roles/test_metrics_retention/.*
- roles/test_observability_strategy/.*
- roles/test_qdr/.*
- roles/test_sensubility/.*
- roles/test_snmp_traps/.*
- roles/test_verify_email/.*
#
- roles/telemetry_graphing
- roles/telemetry_autoscaling
- roles/telemetry_verify_metrics

- job:
name: functional-metric-verification-tests-osp18
Expand All @@ -74,15 +90,29 @@
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/ci-framework'].src_dir }}/scenarios/centos-9/multinode-ci.yml"
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/telemetry-operator'].src_dir }}/ci/vars-autoscaling.yml"
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/vars-metric-verification-test.yml"
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/telemetry-operator'].src_dir }}/ci/vars-power-monitoring.yml"
roles:
- zuul: github.com/openstack-k8s-operators/ci-framework
required-projects: *required_projects
irrelevant-files:
<<: *irrelevant_files
# *irrelevant_files
- .github/.*
- ci/github/.*
- callback_plugins/.*
- README*
- .*/*.md
- roles/client_side_tests/.*
- roles/test_alerts/.*
- roles/test_collectd/.*
- roles/test_metrics_retention/.*
- roles/test_observability_strategy/.*
- roles/test_qdr/.*
- roles/test_sensubility/.*
- roles/test_snmp_traps/.*
- roles/test_verify_email/.*
#
- roles/telemetry_graphing
- roles/telemetry_logging
- roles/telemetry_verify_metrics


- job:
name: feature-verification-tests-noop
Expand All @@ -108,8 +138,23 @@
roles:
- zuul: github.com/openstack-k8s-operators/ci-framework
required-projects: *required_projects
irrelevant-files:
<<: *irrelevant_files
irrelevant-files:
# *irrelevant_files
- .github/.*
- ci/github/.*
- callback_plugins/.*
- README*
- .*/*.md
- roles/client_side_tests/.*
- roles/test_alerts/.*
- roles/test_collectd/.*
- roles/test_metrics_retention/.*
- roles/test_observability_strategy/.*
- roles/test_qdr/.*
- roles/test_sensubility/.*
- roles/test_snmp_traps/.*
- roles/test_verify_email/.*
#
- roles/telemetry_logging
- roles/telemetry_verify_metrics

Expand All @@ -122,7 +167,7 @@
override-checkout: main
irrelevant-files: *irrelevant_files
- functional-tests-on-osp18:
voting: false
voting: true
- functional-logging-tests-osp18
- functional-graphing-tests-osp18
- functional-metric-verification-tests-osp18
7 changes: 7 additions & 0 deletions ci/logging_tests_computes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@
journal_list:
- ceilometer_agent_compute
- nova_compute
common_file_test_id: "RHOSO-12754"
common_file_list:
- /etc/rsyslog.d/10-telemetry.conf
tasks:
- name: "Run Telemetry Logging tests"
ansible.builtin.import_role:
name: telemetry_logging

- name: "Run the tests from the common role"
ansible.builtin.import_role:
name: common
5 changes: 1 addition & 4 deletions ci/logging_tests_controller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
vars:
common_pod_test_id: "RHOS0-12672"
common_pod_test_id: "RHOSO-12672"
common_pod_status_str: "Running"
common_pod_nspace: openstack-operators
common_pod_list:
Expand Down Expand Up @@ -42,9 +42,6 @@
- logging-loki-query-frontend-grpc
- logging-loki-query-frontend-http
- openstack-logging
common_file_test_id: "RHOSO-12754"
common_file_list:
- /etc/rsyslog.d/10-telemetry.conf
tasks:
- name: "Verify logging infrastructure components"
ansible.builtin.import_role:
Expand Down
63 changes: 0 additions & 63 deletions ci/run_autoscaling_osp18.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,6 @@
tags:
- setup

- name: Patch the openstackversions to use the master containers for aodh and heat
ansible.builtin.shell:
cmd: |
oc patch openstackversions controlplane --type merge --patch-file ci/patch-openstack-versions.yaml
chdir: "{{ fvt_dir }}"
when: "{{ patch_openstackversions | bool }}"
tags:
- setup

- name: Redeploy the dataplane
ansible.builtin.shell:
cmd: |
oc get osdpd edpm-deployment -oyaml > /tmp/osdpd.yaml
oc delete osdpd edpm-deployment
sleep 10
oc apply -f /tmp/osdpd.yaml
when: "{{ patch_openstackversions | bool }}"
tags:
- setup

- name: Patch observabilityclient into openstackclient
ansible.builtin.shell:
cmd: |
Expand All @@ -50,50 +30,7 @@
tags:
- setup

- name: Wait until the oscp is resolved the changes to continue
ansible.builtin.shell:
cmd: |
oc get oscp | grep "Setup complete"
retries: 24
timeout: 5
until: output.stdout_lines | length == 1
register: output
when: "{{ patch_openstackversions | bool }}"
tags:
- setup

- name: Wait until the osdpd is redeployed to continue
ansible.builtin.shell:
cmd: |
oc get osdpd | grep "Setup complete"
retries: 60
delay: 45
until: output.stdout_lines | length == 1
register: output
when: "{{ patch_openstackversions | bool }}"
tags:
- setup

- name: "Run Telemetry Autoscaling tests"
ansible.builtin.import_role:
name: telemetry_autoscaling
ignore_errors: true

always:
- name: Revert the version update
ansible.builtin.shell:
cmd: |
oc patch openstackversions controlplane --type json -p='[{"op": "replace", "path": "/spec/customContainerImages", "value": {} }]'
when: "{{ patch_openstackversions | bool }}"

- name: Redeploy the dataplane
ansible.builtin.shell:
cmd: |
oc get osdpd edpm-deployment -oyaml > /tmp/osdpd.yaml
oc delete osdpd edpm-deployment
sleep 10
oc apply -f /tmp/osdpd.yaml
when: "{{ patch_openstackversions | bool }}"
tags:
- setup

18 changes: 18 additions & 0 deletions ci/use-master-containers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
- name: Run telemetry autoscaling tests on osp18
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
gather_facts: true
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
vars_files:
- vars/common.yml
- vars/osp18_env.yml
tasks:
- name: Patch the openstackversions to use the master containers for aodh, heat and ceilometer
ansible.builtin.shell:
cmd: |
oc patch openstackversions controlplane --type merge --patch-file ci/patch-openstack-versions.yaml
chdir: "{{ fvt_dir }}"
tags:
- setup

6 changes: 5 additions & 1 deletion ci/vars-functional-test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---
# temp: skip os-net-setup
# This is added so we skip the os_net_setup role, which would normally be used
# to create a network.
# A network gets created by `make edpm_deploy_instance` during the autoscaling
# tests.
# skip os-net-setup
cifmw_os_net_setup_config: []
post_deploy_00_run_functional_test:
source: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/run_autoscaling_osp18.yml"
Expand Down
4 changes: 4 additions & 0 deletions ci/vars-use-master-containers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
post_ctlplane_deploy_99_modify_openstackversions:
source: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/use-master-containers.yml"
type: playbook
1 change: 1 addition & 0 deletions roles/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ can be set at the play level.
- ceilometer_agent_compute
- ceilometer_agent_ipmi
- node_exporter
- kepler

- name: "Verify Endpoint"
ansible.builtin.import_role:
Expand Down
4 changes: 3 additions & 1 deletion roles/common/tasks/container_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
changed_when: false
register: container_status

- name: Verify container status {{ common_container_test_id }}
- name: |
TEST Verify {{ container_name }} container status
{{ common_container_test_id }}
ansible.builtin.assert:
that:
- "'unhealthy' not in container_status.stdout"
Expand Down
5 changes: 4 additions & 1 deletion roles/common/tasks/cr_tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
- name: Verify that a CR exists {{ common_cr_test_id }}
---
- name: |
TEST Verify that the {{ item.kind }} {{ item.name }} CR exists
{{ common_cr_test_id }}
ansible.builtin.command:
cmd: |
oc get {{ item.kind }} {{ item.name }}
Expand Down
4 changes: 3 additions & 1 deletion roles/common/tasks/crd_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
changed_when: false
register: output

- name: Verify CRD is found "{{ common_crd_test_id }}"
- name: |
TEST Verify CRD {{ item }} is found
{{ common_crd_test_id }}
ansible.builtin.assert:
that:
- "'NotFound' not in output.stderr"
Expand Down
6 changes: 4 additions & 2 deletions roles/common/tasks/endpoint_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
changed_when: false
register: output

- name: Check that endpoint exist {{ common_endpoint_test_id }}
- name: |
TEST Check that {{ item[0] }} {{ item[2] }} endpoint exists
{{ common_endpoint_test_id }}
ansible.builtin.assert:
that:
- output.stdout != ""
success_msg: "The endpoint {{ item[0] }} is found."
fail_msg: "The endpoint for service {{ item[0] }} "
fail_msg: "The endpoint for service {{ item[0] }} on the {{ item[2] }} interface was not found"
22 changes: 17 additions & 5 deletions roles/common/tasks/file_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,20 @@
ansible.builtin.stat:
path: "{{ item }}"
register: fstats
failed_when:
- fstats.stat.pw_name != "root"
- fstats.stat.size | int < 300
- not fstats.stat.exists
- not fstats.stat.isreg

- name: |
TEST Verify the file {{ item }} exists
{{ common_file_test_id }}
ansible.builtin.assert:
that:
- fstats.stat.exists
- fstats.stat.pw_name == "root"
- fstats.stat.size | int > 300
- fstats.stat.isreg
fail_msg: |
File {{ item }} does not meet the required conditions:
{%- if not fstats.stat.exists %} file does not exist.{% endif %}
{%- if fstats.stat.exists and fstats.stat.pw_name != "root" %} file owner must be root (got {{ fstats.stat.pw_name }});{% endif %}
{%- if fstats.stat.exists and fstats.stat.size | int < 300 %} file must be larger than 300 bytes (got {{ fstats.stat.size }} bytes);{% endif %}
{%- if fstats.stat.exists and not fstats.stat.isreg | bool %} file must be a regular file.{% endif %}
success_msg: "The test passed"
2 changes: 1 addition & 1 deletion roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: "Verify pod - {{ common_pod_test_id }}"
- name: "Run pod tests"
when:
- common_pod_test_id is defined
- common_pod_list is defined
Expand Down
6 changes: 4 additions & 2 deletions roles/common/tasks/manifest_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
register: pack_name
changed_when: false

- name: Get packagemanifest "{{ common_manifest_test_id }}"
- name: |
TEST Get {{ item }} packagemanifest
{{ common_manifest_test_id }}
ansible.builtin.shell:
cmd: |
oc get packagemanifests | grep "{{ pack_name.stdout }}" | wc -l
register: num_found
changed_when: false
failed_when: num_expected.stdout != num_found.stdout
failed_when: num_expected.stdout != num_found.stdout
4 changes: 3 additions & 1 deletion roles/common/tasks/pod_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
- podinstance.stdout_lines | length != 1
changed_when: false

- name: Check pod {{ common_pod_test_id }}
- name: |
TEST Check {{ item }} pod is {{ common_pod_status_str }} in {{ common_pod_nspace }} namespace
{{ common_pod_test_id }}
ansible.builtin.command:
cmd: |
oc get pod -n "{{ common_pod_nspace }}" "{{ podinstance.stdout }}"
Expand Down
6 changes: 4 additions & 2 deletions roles/common/tasks/project_tests.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
---
- name: Verify project "{{ item }}"
- name: Get the {{ item }} project
ansible.builtin.shell:
cmd: |
oc get project "{{ item }}"
changed_when: false
register: output

- name: Verify project is found "{{ common_project_test_id }}"
- name: |
TEST Verify {{ item }} project exists
{{ common_project_test_id }}
ansible.builtin.assert:
that:
- "'NotFound' not in output.stderr"
Expand Down
Loading

0 comments on commit 4dbf191

Please sign in to comment.