debian-forge-composer/jenkins/test.yml
Major Hayden 8d59d0c798 🐫 Handle base/image test cases
Speed up test run times by putting base tests and image tests into two
separate jobs in Jenkins. Add support to the testing playbook for both
types of tests and make it easy to add more types later, especially
for image that require booting in the cloud.

Signed-off-by: Major Hayden <major@redhat.com>
2020-04-24 08:55:20 +02:00

37 lines
No EOL
893 B
YAML

---
- hosts: localhost
vars:
passed_tests: []
failed_tests: []
journald_cursor: "{{ ansible_env.JOURNALD_CURSOR"
vars_files:
- vars.yml
tasks:
- name: Run osbuild-composer base tests
include_tasks: test_runner_base.yml
loop: "{{ osbuild_composer_base_tests }}"
loop_control:
loop_var: test
when:
- test_type == 'base'
- name: Run osbuild-composer image tests
include_tasks: test_runner_image.yml
loop: "{{ osbuild_composer_image_tests }}"
loop_control:
loop_var: test
when:
- test_type == 'image'
- name: Show failed and passed tests
debug:
msg: |
Passed tests: "{{ passed_tests }}"
Failed tests: "{{ failed_tests }}"
- name: Fail the test run if a test failed
fail:
msg: One or more tests failed.
when: failed_tests