
- Install prometheus snap - Verify that the alert rules tests pass Change-Id: I38883a431735546bae2033b6f34cc40644231a4c
25 lines
723 B
YAML
25 lines
723 B
YAML
- name: snapd is installed
|
|
apt:
|
|
name: snapd
|
|
become: true
|
|
|
|
- name: prometheus is installed
|
|
snap:
|
|
name: prometheus
|
|
channel: "{{ prometheus_channel | default('2/stable') }}"
|
|
become: true
|
|
|
|
- name: Check if prometheus_alerts_test_rules_dir exists
|
|
stat:
|
|
path: "{{ zuul.project.src_dir }}/{{ prometheus_alerts_test_rules_dir }}"
|
|
register: prometheus_alerts_dir_exists
|
|
|
|
- name: Exit if test rules dir doesn't exist
|
|
fail:
|
|
msg: "Directory {{ prometheus_alerts_test_rules_dir }} does not exist"
|
|
when: not prometheus_alerts_dir_exists.stat.exists
|
|
|
|
- name: promtool tests pass
|
|
command:
|
|
cmd: bash -c 'promtool test rules {{ zuul.project.src_dir }}/{{ prometheus_alerts_test_rules_dir }}/*.yaml'
|