Skip to content

Commit eaffd0d

Browse files
elfiesmelfiemyadla
authored andcommitted
[ci] Write the XML files directly to ci-framework-data/tests/ (#271)
This removes the need to try copying the files around. Update the source directory for custom_junit plugin outputs.
1 parent 337eb6a commit eaffd0d

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

callback_plugins/custom_junit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self):
1818

1919
# Custom environment variable handling
2020
# Update this to parse these values from the config file, as well as the env.
21-
self._output_dir = os.path.expanduser("~/.ansible.log")
21+
self._output_dir = os.path.expanduser("~/ci-framework-data/tests/feature-verification-tests/")
2222
self._test_case_prefix = os.getenv('JUNIT_TEST_CASE_PREFIX', 'TEST')
2323
self._fail_on_ignore = 'true' # this is needed because we use "ignore_errors" on the playbooks so that all the tests are run
2424
self._include_setup_tasks_in_report = os.getenv('JUNIT_INCLUDE_SETUP_TASKS_IN_REPORT', 'False').lower()

ci/report_result.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
- name: "Create the output files"
2+
- name: "Create the output directory"
33
hosts:
44
- controller
55
vars_files:
@@ -22,7 +22,7 @@
2222
- name: "Find the XML file(s)"
2323
ansible.builtin.shell:
2424
cmd: |
25-
find {{ custom_xml_output_dir }} -name *.xml
25+
find {{ logs_dir }} -name *.xml
2626
register: xml_file_list
2727
ignore_errors: true
2828

@@ -31,7 +31,7 @@
3131
var: xml_file_list.stdout_lines
3232
ignore_errors: true
3333

34-
- name: "Collect the XML files, renaming them for the host that they are collected from"
34+
- name: "Copy the XML files"
3535
delegate_to: controller
3636
ansible.builtin.copy:
3737
remote_src: true
@@ -68,7 +68,7 @@
6868
- name: "Get the matching lines in the results files"
6969
ansible.builtin.command:
7070
cmd: |
71-
grep -r "<testsuites .*>$" {{ custom_xml_output_dir }}/
71+
grep -r "<testsuites .*>$" {{ logs_dir }}/
7272
register: verbose_matches
7373
ignore_errors: true
7474

ci/vars/common.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
---
22
fvt_dir: "{{ ansible_env.HOME }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}"
3-
logs_dir: "{{ ansible_env.HOME }}/ci-framework-data/logs/feature-verification-tests"
4-
custom_xml_output_dir: "~/.ansible.log/"
3+
logs_dir: "{{ ansible_env.HOME }}/ci-framework-data/tests/feature-verification-tests"

roles/common/tasks/crd_tests.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88

99
- name: |
1010
TEST Verify CRD {{ item }} is found
11-
{{ common_crd_test_id }}
1211
ansible.builtin.assert:
1312
that:
1413
- "'NotFound' not in output.stderr"
1514
success_msg: "CRD {{ item }} is found."
16-
fail_msg: "CRD {{ item }} not found. Error: {{ output.stderr }}"
15+
fail_msg: "CRD {{ item }} not found. Error: {{ output.stderr }}"

0 commit comments

Comments
 (0)