Skip to content

Commit

Permalink
Add monitoring to each executed test
Browse files Browse the repository at this point in the history
Signed-off-by: Xavi Hernandez <[email protected]>
  • Loading branch information
xhernandez committed Oct 13, 2023
1 parent 561bc45 commit 940e7e2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion playbooks/ansible/client-test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- hosts: clients
- hosts: all
become: yes
become_method: sudo
vars_files:
Expand Down
16 changes: 16 additions & 0 deletions playbooks/ansible/roles/tests/tasks/run-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,27 @@
line: "PREPARING {{ role }}"

- name: Prepare test {{ role }}
when: inventory_hostname in groups['clients']
include_role:
name: "{{ role }}"
tasks_from: prepare/main.yml

- name: Process test {{ role }}
block:
- name: Start monitoring
include_role:
name: monitor
tasks_from: start.yml
vars:
name: "{{ role }}"

- name: Log test start time
include_tasks: log.yml
vars:
line: "RUNNING {{ role }}"

- name: Run test {{ role }}
when: inventory_hostname in groups['clients']
include_role:
name: "{{ role }}"

Expand All @@ -27,6 +36,7 @@
line: "RECOVERING {{ role }}"

- name: Recover from failure of {{ role }}
when: inventory_hostname in groups['clients']
include_role:
name: "{{ role }}"
tasks_from: recover/main.yml
Expand All @@ -37,7 +47,13 @@
vars:
line: "FINISHED {{ role }}"

- name: Stop monitoring
include_role:
name: monitor
tasks_from: stop.yml

- name: Cleanup for {{ role }}
when: inventory_hostname in groups['clients']
include_role:
name: "{{ role }}"
tasks_from: cleanup/main.yml
Expand Down

0 comments on commit 940e7e2

Please sign in to comment.