Skip to content

Commit cb257cf

Browse files
committed
fix cleanup of role tests
1 parent bf3188f commit cb257cf

File tree

3 files changed

+43
-4
lines changed

3 files changed

+43
-4
lines changed

roles/analysis/tests/tests_default.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@
33
hosts: all
44
vars:
55
job_name: test_analysis
6-
roles:
7-
- analysis
6+
tasks:
7+
- name: Test | Run analysis
8+
block:
9+
- name: Test | Run role analysis
10+
ansible.builtin.include_role:
11+
name: infra.leapp.analysis
12+
always:
13+
- name: Cleanup | Remove log files
14+
tags: tests::cleanup
15+
ansible.builtin.shell:
16+
executable: /bin/bash
17+
cmd: |
18+
set -euxo pipefail
19+
rm -f /var/log/leapp/leapp-upgrade.log
20+
rm -f /var/log/ripu/ripu.log*
21+
changed_when: true
822
...
23+

roles/common/tests/tests_default.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@
33
hosts: all
44
vars:
55
job_name: test_common
6-
roles:
7-
- common
6+
tasks:
7+
- name: Test | Run common
8+
block:
9+
- name: Test | Run role common
10+
ansible.builtin.include_role:
11+
name: infra.leapp.common
12+
always:
13+
- name: Cleanup | Remove log files
14+
tags: tests::cleanup
15+
ansible.builtin.shell:
16+
executable: /bin/bash
17+
cmd: |
18+
set -euxo pipefail
19+
rm -f /var/log/leapp/leapp-upgrade.log
20+
rm -f /var/log/ripu/ripu.log*
21+
changed_when: true
822
...

roles/upgrade/tests/tests_default.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,14 @@
2323
- results_errors.stdout_lines | length > 0
2424
vars:
2525
err_pat: This system is not yet registered
26+
always:
27+
- name: Cleanup | Remove log files
28+
tags: tests::cleanup
29+
ansible.builtin.shell:
30+
executable: /bin/bash
31+
cmd: |
32+
set -euxo pipefail
33+
rm -f /var/log/leapp/leapp-upgrade.log
34+
rm -f /var/log/ripu/ripu.log*
35+
changed_when: true
2636
...

0 commit comments

Comments
 (0)