debian-forge-composer/jenkins/test_runner_image.yml
Major Hayden e21a8095b1 📔 Remove the no_log for image tests
Hiding logs makes the output prettier, but it is sometimes easier to see
the problem right there in the Ansible output.

Signed-off-by: Major Hayden <major@redhat.com>
2020-04-29 17:50:25 +02:00

64 lines
2 KiB
YAML

---
- name: Setup test case prefix based on distro and release
set_fact:
test_case_prefix: >-
{%- if ansible_distribution == "Fedora" -%}
fedora_{{ ansible_distribution_version }}-{{ ansible_machine }}
{%- else -%}
rhel_{{ ansible_distribution_version }}-{{ ansible_machine }}
{%- endif -%}
- name: Show which tests will be run
debug:
msg: |
Running the following image test cases:
{% for test_case in osbuild_composer_image_test_cases %}
- {{ test_case | splitext | first }}
{% endfor %}
- block:
# NOTE(mhayden): The fancy jinja2 here ensures that the last test case
# in the list does not have a backslash added. That would make the shell
# upset and nobody likes it when that happens.
- name: "Run image tests"
command: |
{{ image_test_executable }} -test.v \
{% for test_case in osbuild_composer_image_test_cases %}
{% if loop.last %}
{{ image_test_case_path }}/{{ test_case_prefix }}-{{ test_case }}
{% else %}
{{ image_test_case_path }}/{{ test_case_prefix }}-{{ test_case }} \
{% endif %}
{% endfor %}
args:
chdir: "{{ tests_working_directory }}"
register: async_test
async: "{{ image_test_timeout * 60 }}"
poll: "{{ polling_interval }}"
- name: "Mark image tests as passed"
set_fact:
passed_tests: "{{ passed_tests + ['image_tests'] }}"
rescue:
- name: "Mark image tests as failed"
set_fact:
failed_tests: "{{ failed_tests + ['image_tests'] }}"
always:
- name: "Write log for image tests"
copy:
dest: "{{ workspace }}/image_test.log"
content: |
Logs from image test
----------------------------------------------------------------------
stderr:
{{ async_test.stderr }}
----------------------------------------------------------------------
stdout:
{{ async_test.stdout }}