-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TELCOV10N-452 upd role junit2json post CR
- reduce patterns handline and calls to find - reduce number of task - update documentation Signed-off-by: Maxim Kovgan <makovgan@redhat.com>
- Loading branch information
Showing
9 changed files
with
64 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,19 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
--- | ||
# tasks file for role `redhatci.ocp.junit2json` | ||
# collects possibly multiple XMLs from `path_item` (when it is a directory) | ||
# collects possibly multiple XMLs from `item` (when it is a directory) | ||
|
||
- name: Print path_item value | ||
ansible.builtin.debug: | ||
msg: "path_item: {{ path_item }}" | ||
msg: "path_item: {{ item }}" | ||
|
||
- name: Setup helper variable | ||
ansible.builtin.set_fact: | ||
junit2json_find_patterns: "{{ global_reports_path_patterns | map('regex_replace', '^', '*.') | list }}" | ||
cacheable: false | ||
|
||
- name: Check whether the path_item is a directory | ||
- name: Collect the item stat | ||
ansible.builtin.stat: | ||
path: "{{ path_item }}" | ||
path: "{{ item }}" | ||
register: _junit2json_path_item_stat | ||
|
||
- name: "Add path_item as a JUnit XML report [`stat.isdir: false`]" | ||
ansible.builtin.set_fact: | ||
junit2json_reports_list: "{{ junit2json_reports_list + [path_item] }}" | ||
when: | ||
- not(_junit2json_path_item_stat.stat.isdir | default(false)) | ||
|
||
- name: "Find JUnit XML reports under path_item [`stat.isdir: true`]" | ||
ansible.builtin.find: | ||
paths: "{{ path_item }}" | ||
patterns: "{{ global_reports_path_patterns }}" | ||
recurse: false | ||
register: _junit2json_xml_reports_find | ||
when: | ||
- _junit2json_path_item_stat.stat.isdir | default(false) | ||
|
||
- name: Setup the conversion list | ||
ansible.builtin.set_fact: | ||
junit2json_found_xml_reports: "{{ _junit2json_xml_reports_find.files | map(attribute='path') | list }}" | ||
when: | ||
- _junit2json_path_item_stat.stat.isdir | default(false) | ||
- _junit2json_xml_reports_find.matched > 0 | ||
|
||
- name: Setup the default list for conversion | ||
- name: Update junit2json_reports_list with a JUnit XML report item | ||
ansible.builtin.set_fact: | ||
junit2json_reports_list: "{{ junit2json_reports_list + junit2json_found_xml_reports }}" | ||
junit2json_reports_list: "{{ junit2json_reports_list + [item] }}" | ||
when: | ||
- _junit2json_path_item_stat.stat.isdir | default(false) | ||
- junit2json_found_xml_reports | length > 0 | ||
- _junit2json_path_item_stat.stat.exists | default(false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.