The `osbuild-image-tests` code does a good job testing image builds for AWS, but it doesn't use the same code paths that a customer would when using `composer-cli`. Add a test that builds a compose and uploads the image using osbuild-composer and its worker. Also, build an instance in AWS based on the image we imported and check to see if the smoke test file is present. Signed-off-by: Major Hayden <major@redhat.com>
51 lines
1.3 KiB
YAML
51 lines
1.3 KiB
YAML
---
|
|
|
|
- name: Run osbuild-composer tests
|
|
hosts: localhost
|
|
become: yes
|
|
vars:
|
|
passed_tests: []
|
|
failed_tests: []
|
|
vars_files:
|
|
- vars.yml
|
|
tasks:
|
|
|
|
- name: Install osbuild-composer-tests
|
|
dnf:
|
|
name: osbuild-composer-tests
|
|
state: present
|
|
|
|
- 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_test_cases }}"
|
|
loop_control:
|
|
loop_var: test_case
|
|
vars:
|
|
env_vars: "{{ osbuild_composer_image_env_vars }}"
|
|
when:
|
|
- test_type == 'image'
|
|
|
|
- name: Show failed and passed tests
|
|
debug:
|
|
msg: |
|
|
Passed tests: {{ 'None' if not passed_tests else '' }}
|
|
{% for test_name in passed_tests %}
|
|
- {{ test_name }}
|
|
{% endfor %}
|
|
Failed tests: {{ 'None' if not failed_tests else '' }}
|
|
{% for test_name in failed_tests %}
|
|
- {{ test_name }}
|
|
{% endfor %}
|
|
|
|
- name: Fail the test run if a test failed
|
|
fail:
|
|
msg: One or more tests failed.
|
|
when: failed_tests
|