Blame tests/roles/custom-test-fonts/tasks/main.yml
Branch: 8f752ced2a087263e66085f8811c63e2fae61c08
Akira TAGOH
7649bd5
---
Akira TAGOH
7649bd5
Akira TAGOH
7649bd5
- block:
Akira TAGOH
7649bd5
- name: language coverage
Akira TAGOH
8f752ce
environment:
Akira TAGOH
8f752ce
LANG: "en_US.UTF-8"
Akira TAGOH
8f752ce
script: run-lang-coverage-test --lang "{{ item }}" {% if coverage.values is not defined or coverage[item].path_prefix is not defined %} --path {{ path_prefix }} {% else %} {{ '--path "' + (coverage[item].path_prefix | join('" --path "')) + '"' }} {% endif %} --artifactsdir "{{ remote_artifacts }}" {{ "" if coverage.values is not defined or coverage[item].name is not defined else "--name " + coverage[item].name }} {{ "" if coverage.values is not defined or coverage[item].exclude is not defined else '--exclude "' + (coverage[item].exclude | join('" --exclude "')) + '"'}} {{ "" if coverage.values is not defined or coverage[item].include is not defined else '--include "' + (coverage[item].include | join('" --include "')) + '"'}}
Akira TAGOH
7649bd5
with_items:
Akira TAGOH
7649bd5
- "{{ coverage if coverage.keys is not defined else coverage.keys()|list }}"
Akira TAGOH
7649bd5
- name: generic family assignment
Akira TAGOH
8f752ce
environment:
Akira TAGOH
8f752ce
LANG: "en_US.UTF-8"
Akira TAGOH
09cad26
when: families is defined
Akira TAGOH
b0cebe8
script: run-family-test --lang {{ item.lang }} --family '{{ item.family }}' --alias {{ item.alias }} --artifactsdir {{ remote_artifacts }} --package {{ package if item.package is not defined else item.package }}
Akira TAGOH
7649bd5
with_items:
Akira TAGOH
7649bd5
- "{{ families }}"
Akira TAGOH
7649bd5
Akira TAGOH
8f752ce
- name: Collect all of failures into one file
Akira TAGOH
8f752ce
shell: |
Akira TAGOH
8f752ce
grep -v PASS "{{ remote_artifacts }}"/FAIL_*.log > "{{ remote_artifacts }}"/FAIL-all.log || :
Akira TAGOH
8f752ce
Akira TAGOH
7649bd5
- name: Check the results
Akira TAGOH
7649bd5
shell: |
Akira TAGOH
7649bd5
log="{{ remote_artifacts }}/test.log"
Akira TAGOH
7649bd5
if [ ! -f "$log" ]; then
Akira TAGOH
7649bd5
echo ERROR
Akira TAGOH
7649bd5
echo "Test results not found." 1>&2
Akira TAGOH
7649bd5
elif grep ^ERROR "$log" 1>&2; then
Akira TAGOH
7649bd5
echo ERROR
Akira TAGOH
7649bd5
elif grep ^FAIL "$log" 1>&2; then
Akira TAGOH
7649bd5
echo FAIL
Akira TAGOH
7649bd5
elif grep -q ^PASS "$log"; then
Akira TAGOH
7649bd5
echo PASS
Akira TAGOH
7649bd5
else
Akira TAGOH
7649bd5
echo ERROR
Akira TAGOH
7649bd5
echo "No test results found." 1>&2
Akira TAGOH
7649bd5
fi
Akira TAGOH
7649bd5
register: test_results
Akira TAGOH
7649bd5
Akira TAGOH
7649bd5
- name: Set role result
Akira TAGOH
7649bd5
set_fact:
Akira TAGOH
7649bd5
role_result: "{{ test_results.stdout }}"
Akira TAGOH
7649bd5
role_message: "{{ test_results.stderr|d('test execution error.') }}"
Akira TAGOH
7649bd5
role_result_failed: "{{ test_results.stdout != 'PASS' }}"
Akira TAGOH
7649bd5
role_result_msg: "{{ test_results.stderr|d('test execution error.') }}"
Akira TAGOH
7649bd5
Akira TAGOH
7649bd5
- include_role:
Akira TAGOH
7649bd5
name: str-common-final
Akira TAGOH
8f752ce
Akira TAGOH
8f752ce
- name: Validate the result
Akira TAGOH
8f752ce
shell: echo "test_results.stdout"
Akira TAGOH
8f752ce
failed_when: test_results.stdout != 'PASS'