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 authored and anoopcs9 committed Mar 8, 2024
1 parent 9059b7a commit 3fa8c54
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 @@ -41,7 +51,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 3fa8c54

Please sign in to comment.