Skip to content

Commit

Permalink
[test_alerts] Add check for Prometheus rule deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
elfiesmelfie committed Nov 22, 2024
1 parent 562dcb9 commit 17863ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions roles/test_alerts/tasks/test_create_an_alert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
until: '"FVT_TESTING Collectd metrics receive rate is zero" in cmd_output.stdout'

always:
- name: "Delete the alert"
- name: "Delete the PrometheusRule"

Check failure on line 45 in roles/test_alerts/tasks/test_create_an_alert.yml

View workflow job for this annotation

GitHub Actions / build

no-changed-when

Commands should not change things if nothing needs doing.

Check failure on line 45 in roles/test_alerts/tasks/test_create_an_alert.yml

View workflow job for this annotation

GitHub Actions / build

no-changed-when

Commands should not change things if nothing needs doing.
ansible.builtin.command:
cmd: |
oc delete prometheusrule.{{ observability_api }} fvt-testing-prometheus-alarm-rules
- name: Wait up to two minutes until the alert is deleted
- name: Wait up to two minutes until the rule is deleted

Check failure on line 50 in roles/test_alerts/tasks/test_create_an_alert.yml

View workflow job for this annotation

GitHub Actions / build

no-changed-when

Commands should not change things if nothing needs doing.

Check failure on line 50 in roles/test_alerts/tasks/test_create_an_alert.yml

View workflow job for this annotation

GitHub Actions / build

no-changed-when

Commands should not change things if nothing needs doing.
ansible.builtin.command:
cmd: |
curl -k {{ prom_auth_string }} https://{{ prom_url }}/api/v1/rules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
for i in {1..15}; do oc delete po -l application=default-interconnect; sleep 1; done
changed_when: false

# The wget executable is not available in prometheus container
- name: "RHELOSP-148698 Verify that the alert is active in Alertmanager"
ansible.builtin.shell:
cmd: >-
Expand Down Expand Up @@ -103,6 +102,14 @@
ansible.builtin.command: |
oc delete prometheusrule.{{ observability_api }} fvt-testing-prometheus-alarm-rules
- name: "Wait up to two minutes until the rule is deleted"

Check failure on line 105 in roles/test_alerts/tasks/test_creating_a_standard_alert_route_in_alert_manager.yml

View workflow job for this annotation

GitHub Actions / build

no-changed-when

Commands should not change things if nothing needs doing.

Check failure on line 105 in roles/test_alerts/tasks/test_creating_a_standard_alert_route_in_alert_manager.yml

View workflow job for this annotation

GitHub Actions / build

no-changed-when

Commands should not change things if nothing needs doing.
ansible.builtin.command:
cmd: |
curl -k {{ prom_auth_string }} https://{{ prom_url }}/api/v1/rules
retries: 12
delay: 10
until: 'not "FVT_TESTING Collectd metrics receive rate is zero" in cmd_output.stdout'

- name: "Wait up to 2 minutes to make sure all default-interconnect pods are back"
ansible.builtin.command:
oc get pods -l application=default-interconnect
Expand Down

0 comments on commit 17863ff

Please sign in to comment.