mirror of
https://github.com/ostreedev/ostree.git
synced 2025-03-21 02:50:37 +03:00
It's cleaner to separate test playbooks from their tasks. Closes: #1535 Approved by: jlebon
42 lines
1.2 KiB
YAML
42 lines
1.2 KiB
YAML
# Nondestructive sysinstalled tests, run in parallel.
|
|
---
|
|
- hosts: localhost
|
|
tags:
|
|
- atomic
|
|
remote_user: root
|
|
vars:
|
|
use_git_build: True
|
|
tests: "."
|
|
# Arbitrary...we want some parallelism
|
|
batching_factor: 4
|
|
tasks:
|
|
- import_tasks: tasks/query-host.yml
|
|
- import_tasks: tasks/overlay-git.yml
|
|
when: use_git_build
|
|
# Next copy all of the tests/ directory
|
|
- name: Copy test data
|
|
synchronize: src=../../ dest=/root/tests/ archive=yes
|
|
- find:
|
|
paths: /root/tests/installed/nondestructive
|
|
patterns: "itest-*.sh"
|
|
register: all_tests
|
|
- set_fact:
|
|
selected_tests: "{{ all_tests.files|map(attribute='path') | select('match', tests) | list }}"
|
|
- assert:
|
|
that:
|
|
- "{{ selected_tests|length }} != 0"
|
|
- file: path=/root/logs state=directory
|
|
- block:
|
|
- name: Run nondestructive tests
|
|
vars:
|
|
logdir: /root/logs
|
|
async_commands: "{{ item }}"
|
|
include_tasks: execute_batch.yml
|
|
with_items:
|
|
- "{{ selected_tests | batch('{{ batching_factor }}') | list }}"
|
|
always:
|
|
- synchronize:
|
|
src: /root/logs
|
|
dest: artifacts/installed-nondestructive
|
|
mode: pull
|