| |
@@ -43,6 +43,43 @@
|
| |
"{{ repositories }}"
|
| |
when: repositories is defined
|
| |
|
| |
+ # Prepare the filter command (check 'filter' variable for tests
|
| |
+ # stored directly in the repo and also 'filter' key for each
|
| |
+ # fetched test repo dictionary in the 'repositories' list).
|
| |
+ - set_fact:
|
| |
+ filter_command: "str-filter-tests"
|
| |
+ - set_fact:
|
| |
+ filter_command: "{{ filter_command }} . '{{ fmf_filter }}'"
|
| |
+ when: fmf_filter is defined
|
| |
+ - set_fact:
|
| |
+ filter_command: "{{ filter_command }} '{{ item.dest }}' '{{ item.fmf_filter }}'"
|
| |
+ with_items:
|
| |
+ - "{{ repositories }}"
|
| |
+ when: repositories is defined and item.fmf_filter is defined
|
| |
+ - debug:
|
| |
+ var: filter_command
|
| |
+ verbosity: 1
|
| |
+
|
| |
+ # Filter tests based on the gathered parameters. (The filter
|
| |
+ # command is extended for each provided filter. That's why
|
| |
+ # there's check for filter_command != "str-filter-tests" which
|
| |
+ # ensures that there has been at least one filter defined.)
|
| |
+ - set_fact:
|
| |
+ filter_tests: []
|
| |
+ - name: Filter tests according to provided fmf filters
|
| |
+ shell: "{{ filter_command }}"
|
| |
+ register: filter_output
|
| |
+ when: filter_command != "str-filter-tests"
|
| |
+ - debug:
|
| |
+ var: filter_output
|
| |
+ verbosity: 2
|
| |
+ - set_fact:
|
| |
+ filter_tests: "{{ filter_output.stdout_lines }}"
|
| |
+ when: filter_output.stdout_lines is defined
|
| |
+ - debug:
|
| |
+ var: filter_tests
|
| |
+ verbosity: 1
|
| |
+
|
| |
- debug:
|
| |
msg: >
|
| |
{{ test_runner_inventory_name }} is:
|
| |
This adds basic support for test selection based on metadata. The
new "filter" variable and dict key under "repositories" accepts a
single fmf filter. Separate script "str-filter-tests" is used to
check provided paths and filters and lists appropriate tests on
the standard output. Manual test listing can be combined with the
filter functionality as well.